Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
I'm doing a macro that gets the user to select a bezier, then changes the line thickness of part of that bezier.
To let me know which segments to change, I need to know two things:
Are these things possible?
The reason for wanting this information is:
When we convert IGES drawings to 2d, it leaves thick lines where bolt heads rest against metal and we change them to thin. Annoyingly, there is always 1 bezier line that needs to be half thick and half thin. I can't predict how many segments these lines have (often 6) or which way round the line has generated, so I'm never sure which segments to change. If I know, for example that the user selected segment 2 of 6, I know to change line thicknesses of the first 3 segments.
Here's the answer to #1. If you have problems with this, I did do it the long way (loop) first.
Macro PartCount
Define E1 as Element
E1=ActiveDoc.FirstSelectedElement
Message E1.SegmentCount
End Macro
Thanks Trevor. This helps a lot. I guess the only way to know which segment I have actually selected would be to check straight lines between end points of each segment and the one that comes closest to the picked point is it.