Removing dimension leader not visible - only after reselection or reopening mode

Removing dimension leader not visible - only after reselection or reopening mode

Anonymous
Not applicable
872 Views
4 Replies
Message 1 of 5

Removing dimension leader not visible - only after reselection or reopening mode

Anonymous
Not applicable

Hi,

 

I am trying to remove the dimenionleader using the API. I have set value of builtinparameter 'DIM_LEADER' to '0' and that removes the dimension leader. The removal however is only visible after manually selecting / unselecting the changed dimension (or closing / opening the model al together).

 

Is there a way to 'regenerate' the dimension (doc.regenerate does not seem to do it)?

 

regards,

Raymond

 

0 Likes
873 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk

Dear Raymond,

 

Thank you for your query.

 

There are several ways to trigger a regeneration.

 

Doc.Regen is one of them.

 

The next 'harder' one is to call Commit on an open transaction.

 

If those do not help, you might want to try simulating some other database modification which is 'harder' still, e.g., moving something by a vector of length zero, or 'harder' still, moving something by a small amount in one direction, committing the transaction, and then moving it back again in a second transaction.

 

Here is a whole bunch of examples illustrating the need to regenerate and various ways to achieve that:

 

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

 

I hope this helps.

 

Best regards,

 

Jeremy



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

0 Likes
Message 3 of 5

Anonymous
Not applicable

Hi Jeremy,

 

doc.regenerate and uidoc.RefreshActiveView do not seem to do the trick. 

 

Your suggestion about moving the object is a good one. Moving the dimension up and down within the same transaction (no need for two transactions) regenerates the dimension and removes the leaders.

 

ElementTransformUtils.MoveElement(m_doc, dimRef.Id, New XYZ(0, 0, 0.1))
ElementTransformUtils.MoveElement(m_doc, dimRef.Id, New XYZ(0, 0, -0.1))

 

Thanks for the suggestion,

 

Raymond

 

0 Likes
Message 4 of 5

jeremytammik
Autodesk
Autodesk

Dear Raymond,

Wow, I am very glad to hear that it helped.

 

Thank you for the confirmation.

 

You need to watch out what movement you make and ensure that it does not do something horrible such as disconnecting connected objects or triggering a warning of some kind.

 

Best regards,

Jeremy



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

0 Likes
Message 5 of 5

jeremytammik
Autodesk
Autodesk

Dear Raymond, 

Wow, I am very glad to hear that it helped.

 

Thank you for the confirmation.

 

You need to watch out what movement you make and ensure that it does not do something horrible such as disconnecting connected objects or triggering a warning of some kind.

 

Best regards,

Jeremy



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

0 Likes