Can anyone tell me how to obtain the names (e.g. Point1, Line3, Spline2, etc...) of the sketchsegments in an active sketch. SolidWorks shows this information when right-clicking on a sketchsegment. However, I don't seem to find any API-function which gives me that info. I need these names for use with SelectByID2. Any help is greatly appreciated!
Yes, I also thought it was that simple. But sadly enough the interface SketchSegment doesn't seem to have a function GetName or something like that. Or I'm not seeing it? It has GetID but that gives me two integers and that's not what I'm searching for.
"Evan T. Basalik" schreef in bericht news:BZfvd.70000$ email@example.com...
Are you selecting segments that you created durring the running macro or created before hand. How are you going to know wether you want Line1, Line2 or Line15. I ask because there may be another way to select the appropriate line without the SelectByID.
I am selecting existing segments created outside a macro. Let me explain the situation. We're programming an addin using C#. This addin helps us to create aluminium constructions (conservatories). One point of our design is the creation of the roof panels. The sketch which defines the roof panel must be dimensioned. Therefore I need to select sketchpoints and sketchsegments (lines). I was going to use the API-functions SketchPoint.Select4 and SketchSegment.Select4, but these are flawed when using in-context. I have reported this to SW and they've issued SPR's. However, I am trying to work around the problem. That's why I'm trying to use SelectByID. This function works correctly, but only when I can give the sketch entity name as a parameter. Unfortunately, there doesn't seem to be a way to retrieve that name. I hope this clarifies the situation a bit.
"CS" schreef in bericht news: firstname.lastname@example.org...
A stab in the dark but if you use Sketch.GetLines2 and assume that the first segment in the safe array would be Line1 and the second Line2, or more likely ID has something to do with the number. If I had time I would test some code for you but I just don't today.