Ed
unread,May 10, 2009, 9:56:01 AM5/10/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SolidWorks-API
I get an error 91 when I click the cmdBuild button.
Object Variable or with block variable not set.
swModel.SketchManager.AddToDB = True
So each word after the . notation was inserted...
they must be correct right,If it pops up after the . and you insert
it....
Object...swModel
variable...SketckManager
member...AddTo DB
We Dim...(define) the object right... then select a Method and a
value...?
I don't understand what's wrong here?
Private Sub cmdBuild_Click()
Set swApp = Application.SldWorks
Set swModel = swApp.NewDocument(filedir + _
"APIPart.prtdot", 0, 0#, 0#)
swModel.SketchManager.AddToDB = True
swModel.SetUserPreferenceIntegerValue swUnitsLinear, swMM
'MATERIAL
If optAl.Value = True Then
swModel.SetUserPreferenceDoubleValue _
SwConst.swMaterialPropertyDensity, 2700
swModel.SetUserPreferenceStringValue _
SwConst.swMaterialPropertyCrosshatchPattern, _
"ISO (Aluminum)"
Else
swModel.SetUserPreferenceDoubleValue _
SwConst.swMaterialPropertyDensity, 8600
swModel.SetUserPreferenceStringValue _
SwConst.swMaterialPropertyCrosshatchPattern, _
"ISO (Bronze Brass)"
End If