Has anyone gotten IDrawingDoc method AddChamferDim to workproperly on a drawing? I am trying to use VB.Net. I have also triedrecording a macro that uses the chamfer dimension tool. The macrocrashes solidworks. My VB.NET program either crashes, continueswithout doing anything or crashes solidworks depending on what thenext line is. Any tips? Code below:
Macro:
boolstatus = Part.Extension.SelectByID2("", "SILHOUETTE",0.2823195102109, 0.1998461346505, -2201.923076923, False, 0,Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "SILHOUETTE",0.2805177116426, 0.1993656550323, -2201.923076923, True, 0,Nothing, 0)
Set myDim = Part.AddChamferDim(0.2949321001889, 0.1958221178634, 0)
vb.net:
xIModelDocExtension.SelectByID2("",swSelectType_e.swSelSILHOUETTES, xZero + 1 / 8 / 2 / scaleFactor *meterConversionFactor, yCenter + SDB / 2 - 1 / 8 / 2 / scaleFactor* meterConversionFactor, _
0, False, 0, Nothing, 0)
xIModelDocExtension.SelectByID2("",swSelectType_e.swSelSILHOUETTES, xZero + 1 / 4 / scaleFactor *meterConversionFactor, yCenter + SDB / 2, _
0, True, 0, Nothing, 0)
xIDrawingDoc.AddChamferDim(0, 0, 0)SolidworksApi macros
Macro:
boolstatus = Part.Extension.SelectByID2("", "SILHOUETTE",0.2823195102109, 0.1998461346505, -2201.923076923, False, 0,Nothing, 0)
boolstatus = Part.Extension.SelectByID2("", "SILHOUETTE",0.2805177116426, 0.1993656550323, -2201.923076923, True, 0,Nothing, 0)
Set myDim = Part.AddChamferDim(0.2949321001889, 0.1958221178634, 0)
vb.net:
xIModelDocExtension.SelectByID2("",swSelectType_e.swSelSILHOUETTES, xZero + 1 / 8 / 2 / scaleFactor *meterConversionFactor, yCenter + SDB / 2 - 1 / 8 / 2 / scaleFactor* meterConversionFactor, _
0, False, 0, Nothing, 0)
xIModelDocExtension.SelectByID2("",swSelectType_e.swSelSILHOUETTES, xZero + 1 / 4 / scaleFactor *meterConversionFactor, yCenter + SDB / 2, _
0, True, 0, Nothing, 0)
xIDrawingDoc.AddChamferDim(0, 0, 0)SolidworksApi macros
