 |
| View previous topic :: View next topic |
| Author |
Message |
angiepeters Newbie
Joined: 11 May 2005 Posts: 2
|
Posted: May 11th, 2005 09:39 AM Post subject: run time error 91 |
|
|
I am trying to write code that will set parameters in Catia (a 3d modelling program) to values I have in excel. when I run it I get Run-time error 91 'Object variable or with block variable not set' and highlites the line 'set windowasm....'
I am new at this stuff and can't figure out what I am doing wrong.
Hope someone can help me!
Dim CATDocs As Documents
Dim specsAndGeomWindow1 As Window
Dim base As Document
Dim jaw As Document
Dim windowasm As ProductDocument
Dim windowprod As Product
Dim parameterslist As Parameters
Dim viewer3D1 As Viewer
Private Sub CommandButton1_Click()
Dim catia As Object
On Error Resume Next
Set catia = GetObject(, "CATIA.Application")
If Err.Number = 425 Then
Set catia = CreateObject("CATIA.Application")
Err.Clear
End If
On Error GoTo 0
osmwidth = Sheet1.Cells(12, 4).Value
osmheight = Sheet1.Cells(14, 4).Value
osmradius = Sheet1.Cells(20, 4).Value
Set windowasm = catia.Documents.Open("C:\Documents and Settings\Administrator\My Documents\skeleton\CTC3\Product1.CATProduct")
Set windowprod = windowasm.Product
Set parameterList = windowprod.Parameters
Set OverallWidth = parameterList.Item("Overall Width")
OverallWidth.Value = osmwidth
Set OverallHeight = parameterList.Item("Overall Height")
OverallHeight.Value = osmheight
Set RadLeg = parameterList.Item("Camber (leg/rad)")
RadLeg.Value = osmradius
windowprod.Update
Set SpecsAndGeomWindow = catia.ActiveWindow
Set viewer3D1 = SpecsAndGeomWindow.ActiveViewer
viewer3D1.Reframe
End Sub |
|
| Back to top |
|
angiepeters Newbie
Joined: 11 May 2005 Posts: 2
|
Posted: May 13th, 2005 01:30 PM Post subject: |
|
|
Nevermind.
It turns out, it was a registration problem with the 3d modelling program.
Once that issue was resolved, it ran fine. |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|