Hi guys,
when I create a new sketch, how can I change the name of the sketch?
thanks,
john
Hi John
After the create sketch, and exit. Select it and press F2.
If You want change name the feature do the same or, select in Option - FeatureManager - Name feature on creation.
after the operation, the name will be able to edit
thanks for your reply. but, what I want is to change the name in my addin programmatically.
Sub main()
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Part.SketchManager.InsertSketch True
Dim vSkLines As Variant
vSkLines = Part.SketchManager.CreateCornerRectangle(-0.06353895446837, 0.02724775866296, 0, 0.02196263306023, -0.02208008029585, 0)
Dim feat As SldWorks.Feature
Set feat = Part.FeatureByPositionReverse(0)
feat.Name = "newName2"
End Sub
Hi John
After the create sketch, and exit. Select it and press F2.
If You want change name the feature do the same or, select in Option - FeatureManager - Name feature on creation.
after the operation, the name will be able to edit
thanks for your reply. but, what I want is to change the name in my addin programmatically.
john
Sub main()
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Part.SketchManager.InsertSketch True
Dim vSkLines As Variant
vSkLines = Part.SketchManager.CreateCornerRectangle(-0.06353895446837, 0.02724775866296, 0, 0.02196263306023, -0.02208008029585, 0)
Part.SketchManager.InsertSketch True
Dim feat As SldWorks.Feature
Set feat = Part.FeatureByPositionReverse(0)
feat.Name = "newName2"
End Sub