Modify the position of the dimension

Modify the position of the dimension

Anonymous
Not applicable
2,492 Views
2 Replies
Message 1 of 3

Modify the position of the dimension

Anonymous
Not applicable

hello,

I am looking for a way to move the dimensions of Figure a as shown in Figure b.

(Using revit API)

 

a)2017-09-19 09;14;40.PNG     

b)  2017-09-19 09;15;49.PNG

0 Likes
Accepted solutions (1)
2,493 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk

You can probably achieve what you need using the dynamic model update framework DMU:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.31

 

The DynamicModelUpdate SDK sample demonstrates its use:

 

Dynamic Model Update used to maintain relative position between elements: Move a section marker to maintain relative position with a window; When execute the AssociativeSectionUpdater Command:

 

  • Register the SectionUpdater
    • Select a view section element and a window, it will associate the two element.
    • Add a trigger so that the SectionUpdater class will be invoked for any geometry change to the window
  • When the geometry of a window changes
    • Move the section to a new location based the window’s location point and rotate the section and make it vertical to the window’s FacingOrientation.
    • The calculation is on the RejustSectionView function.

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 3

aignatovich
Advisor
Advisor
Accepted solution

Hi!

 

The easiest way to achieve it may looks like this (Iron python shell code):

 

dimension = selection[0] # selected dimension

tx = Transaction(doc, "move dimension")
tx.Start()

ElementTransformUtils.MoveElement(doc, dimension.Id, 0.5*XYZ.BasisY)

tx.Commit()

 

Of course you need to determine shift direction and distance, I don't know these rules

 

@jeremytammiksuggested how to do it automatically

0 Likes