Hallo to the community,
I have a lot of multibody parts (part inserted inside a part) where inside the import function is activated the import flag of the customproperties import. I need to swith it off and the idea is to write a macro due to the big amount of files that need to be changed. I have recorded the macro, but it seems not working. Is it accessable this flag throught API?
This is my code on SW 2020:
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("40120056", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0)
' Edit Derived Part Begin
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("40120056", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0)
Dim swFeature As Object
Set swFeature = Part.SelectionManager.GetSelectedObject6(1, -1)
Dim swComponent As Object
Set swComponent = Part.SelectionManager.GetSelectedObjectsComponent3(1, -1)
Dim swDerivedPartFeatureData As Object
Set swDerivedPartFeatureData = swFeature.GetDefinition()
swDerivedPartFeatureData.ImportModelDimensions = True '<<<
boolstatus = swFeature.ModifyDefinition(swDerivedPartFeatureData, Part, swComponent)
' Edit Derived Part End
Part.ClearSelection2 True
Part.ClearSelection2 True
End Sub
I tryed to change other properties of this function, but this property is not a bool and is not changing...no problem with the bool.
Thank you.