I have search and search; before I go too far.
Looking to build a quote module VBA api within Solidworks to calculate the amount of support material needed for our prototype machine. Our machine is a Polyjet machine, so the support is measuring the unsupported ledges up the part based on part orientation.
Looking for any suggestions on existing code or approaches before I go too far; and realize it is already out there, and I just missed it.
Any help would be appreciated.
I wrote some code which move a small thin block up and subtract off the main body. At each level it will calculate the volume.
It uses the Insert Combine feature. It will error out in two cases; where there is a geometry condition as well as when the main body is consumed.
Ideally I would like to get the error and define a specific action using an if statement.
Any suggestions would be appreciated or possibly a better approach.
Thanks,
Kelson
I am using the InsertCombine Feature
Set myfeature = swModel.FeatureManager.InsertCombineFeature(15902, Nothing, Nothing)
If myfeature Is Nothing Then
swModel.ClearSelection2 True
bRet = swModExt.SelectByID2("Cut" & "Step" & level & " i" & i, sBodyTypeSelStr, 0#, 0#, 0#, True, 2, Nothing, 0): Debug.Assert bRet
Set myfeature = swModel.FeatureManager.InsertDeleteBody
'just added
bRet = swModExt.SelectByID2("Slice" & "Step" & level & " i" & i, sBodyTypeSelStr, 0#, 0#, 0#, True, 1, Nothing, 0): Debug.Assert bRet
Set myfeature = swModel.FeatureManager.InsertDeleteBody
End If
Message was edited by: Kelson Lachance
SolidworksApi macros