1

I wrote a tool which draws model curves on a view and adds dimensions to it. The tool when run locally on my computer it works fine, lines are drawn and dimension are added and visible.

But, when I upload the code to Forge Design Automation, the lines are drawn and dimensions added. However the dimensions are not visible. After I downloaded the rvt file I can see the dimension through Revit Lookup, but not directly on the view.

Any suggestions where I might be going wrong?

Here is my code...

mCurve.LineStyle = buildingLineStyle;
//Adding dimension
ReferenceArray references = new ReferenceArray();
references.Append(mCurve.GeometryCurve.GetEndPointReference(0));
references.Append(mCurve.GeometryCurve.GetEndPointReference(1));
Dimension dim = doc.Create.NewDimension(groundFloor, line, references);

//Moving dimension to a suitable position  
ElementTransformUtils.MoveElement(doc, dim.Id, 2 * XYZ.BasisY);

Thanks for your time in looking into this issue.

1 Answers1

0

Thank you for your query and sorry to hear you are encountering this obscure problem.

I have no complete and guaranteed solution for you, but similar issues have been discussed in the past in the pure desktop Revit API, and two workarounds were suggested that might help in your case as well:

One workaround consists in creating a new dimension using the Reference objects obtained from the non-visible one.

The other one, in moving the dimension up and down within the same transaction to regenerate it.

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • Jeremy, thanks for your help. I have tried your suggestion by creating new dimension using the Reference objects contained from the non-visible one, but no use. The Dimension hidden status is False, but not still not showing. Any suggestions? – Nagarjuna Nag Kora Dec 19 '19 at 01:40
  • The same suggestion as always: (i) try it out manually in the Revit end user interface and analyse all the resulting elements, their properties and relationships in depth. (ii) implement it in the desktop Revit API and ensure that all element, properties and relationships are identical. (iii) repeat in the DA4R environment. Details on the first two steps: http://thebuildingcoder.typepad.com/blog/2017/01/virtues-of-reproduction-research-mep-settings-ontology.html#3 + http://thebuildingcoder.typepad.com/blog/2013/11/intimate-revit-database-exploration-with-the-python-shell.html – Jeremy Tammik Dec 19 '19 at 07:36