How do I add leaders to General Dimensions with iLogic?

How do I add leaders to General Dimensions with iLogic?

duke
Enthusiast Enthusiast
468 Views
2 Replies
Message 1 of 3

How do I add leaders to General Dimensions with iLogic?

duke
Enthusiast
Enthusiast

I am using iLogic to create several linear dimensions on a drawing. The code works great, but when the dimensioned segment is too small the dimension goes above or below the section. I would like to be able to use iLogic to add a leader to the dimension like you can by right-clicking, choosing options, then leader. Can this be done with iLogic?

 

For reference, this is the code snippet I use to create the dimensions:

'Add the dimension to the sheet.
oSheet.DrawingDimensions.GeneralDimensions.AddLinear(oPoint, oIntent1, oIntent2)

 This is what is happening:

duke_0-1704391048915.png

 

This is what I'd like to be able to do with iLogic:

duke_1-1704391104992.png

 

Finally, this is the manual method that I have used and want automated:

duke_2-1704391160281.png

 

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

WCrihfield
Mentor
Mentor
Accepted solution

Hi @duke.  When you use that AddLinear method, it creates a LinearGeneralDimension, which is a Type that is derived from the GeneralDimension Type, but has more specific properties for that more specific type of dimension.  If you create that type of variable ahead of time, and set its value using that method, then you will be left with this variable that you can use in later lines of code.  Then you could use its property LinearGeneralDimension.ShowLeader, which the less specific GeneralDimension Type does not have.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

duke
Enthusiast
Enthusiast
Thanks! That worked perfectly! I can't believe it was such a simple solution to my problem, but I really appreciate your help!
0 Likes