API, retrieving names of sketch entities.

Hi,
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!
Thanks, Tony
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
I would think you could use the Sketch.GetSketch segments call to get a handle to sketch segments in the sketch. Then, you can just iterate through those to get the names.
Evan

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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.
Thanks, Tony
"Evan T. Basalik" <Evan(do not dare spam me -

sketchsegment.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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.
Corey

Spline2,
info.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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.
Regards, Tony

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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.
Corey

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Hi Try SketchSegment::GetID this gives you a uniq couple of numbers ,associated with the type of segment, which corresponds to the number you see in the selection.
regards
dudi peer
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Yes, this does the trick. Thanks to you all for your input !!
Regards, Tony

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.