Can I name SketchPoints like I name WorkPlanes (for example)? C++ COM

Can I name SketchPoints like I name WorkPlanes (for example)? C++ COM

oransen
Collaborator Collaborator
479 Views
2 Replies
Message 1 of 3

Can I name SketchPoints like I name WorkPlanes (for example)? C++ COM

oransen
Collaborator
Collaborator

I find it useful that I can name parts, sketches and workplanes, but it seems I cannot name SketchPoint objects.

 

I may be looking in the wrong place but for example this does not work.

 

    CComPtr<SketchPoint> pInventorPt;
     pSketch->SketchPoints->Add (pThePoint,VARIANT_TRUE,&pInventorPt);
    
// Change the name of the point... pInventorPt->Name = L"OWENS POINT" ; // !!!COMPILER ERROR HERE!!!

 

Is it possible to assign an id to SketchPoints and other sketch entities?

 

(An aside: I suppose I'm asking how to identify specific objects in a sketch. For example there may be two center points and my program needs to get hold of the correct one.)

 

 

 

 

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

Vladimir.Ananyev
Alumni
Alumni
Accepted solution

SketchPoint object has no name property similar to WorkPlane names you see in the Model browser.

But API provides two options you may find useful.

1. Attributes is the simplest way to label your sketch points.

2. Reference keys as  native object IDs. 

Useful links:

Inventor API Help contains the overview on Attributes and AttributeSets. See also

 http://modthemachine.typepad.com/my_weblog/2009/07/introduction-to-attributes.html

There are several posts on attributes and reference keys on ADN Manufacturing DevBlog http://adndevblog.typepad.com/manufacturing/ 

(e.g., http://adndevblog.typepad.com/manufacturing/2012/06/using-attribute-sets-in-c.html, http://adndevblog.typepad.com/manufacturing/2012/06/use-reference-keys-in-c.html)


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 3 of 3

oransen
Collaborator
Collaborator
Thanks for the into and suggestions.
0 Likes