Hello all,
My add-in is inserting axes and coordinate systems into a model. When I insert a coordinate system, I can easily change the name by doing the following (C#):
//Assume sketch entities are properly selected
Feature coordinates = ActiveSWModel.FeatureManager.InsertCoordinateSystem(false, false, false);
coordinates.Name = Joint.CoordinateSystemName;
When you insert an axis, you don't get the inserted feature returned. You also aren't given what the name is so you can't SelectByID. If it was the very first axis inserted into a sketch it would start at "Axis1" and continue in number, but I don't want to rely on that. I'm doing the following and need to fill in the bolded code below.
//Assume sketch entity is properly selected
bool inserted = ActiveSWModel.InsertAxis2(true);
string axisName = code to get the name of the axis that was just inserted
ActiveSWModel.Extension.SelectByID2(axisName, "AXIS", 0, 0, 0, false, 0, null, 0);
SelectionMgr selectionManager = ActiveSWModel.SelectionManager;
Feature Axis= selectionManager.GetSelectedObject6(1, 0);
Axis.Name = "My new axis name"
My only approach so far is to find all the axes before, and then find all the axes after and find the one that was added
Thanks for reading