creating plane

Hi.

In a assembly, I have several plane to create and  rename it.

 

With a api ( vb.net ) program i use a FOR loop to create it, and rename it.

I notice that my plane name start with PLANE1, PLANE 2.....so i use a flag ( NO_PLANE  = NO_PLANE +1) to have my increment.

To make my program more idiot proof, I would like to get the name of the plane i just create.

There is a way to get it????

The method ( InsertRefPlane ) return a RefPlane, but i cant have to name of it.

 

my line to create plane :

myRefPlane=CType(swDoc.FeatureManager.InsertRefPlane(8, PLAN_DIST * 0.0254, 0, 0, 0, 0), RefPlane)

my line to rename plane :

   

status= swDoc.Extension.SelectByID2("PLANE" & NO_PLANE, "PLANE", 0, 0, 0, False, 0, Nothing, 0)

status = swDoc.SelectedFeatureProperties(0, 0, 0, 0, 0, 0, 0, 1, 0, PLAN_NEW)

SolidworksApi macros
Answers 2
AT
AT 2013-10-21 Best Answer

You can cast RefPlane to feature and get/set the name:

<p>Dim myFeat as Feature</p><p>myRefPlane=CType(swDoc.FeatureManager.InsertRefPlane(8, PLAN_DIST * 0.0254, 0, 0, 0, 0), RefPlane)</p><p>myFeat = CType(myRefPlane, Feature)</p><p>Dim name as String = myFeat.Name</p><p>myFeat.Name = "New Name"</p>

____________________________________________________

Regards,

Artem Taturevych, Application Engineer at Intercad (Australia)

translationXpert – add-in to translate SolidWorks models

myIntercad – an integrated tool for SolidWorks Professionals

LinkedIn SolidWorks API Education Group

SF
SF 2013-10-23

Thank' s  Artem

Il works very well.     easy, simple, full idiot proof

The more use API, the more I reduce my desing time