Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use GetVolume in a CATIA macro?

Status
Not open for further replies.

ROST

Mechanical
Jan 12, 2004
1
SE
Hello

I like to get the volume of a selected element from a macro.
The following code gives the error "type mismatch":

Sub CATMain()
CATIA.ActiveDocument.Selection.Clear()
Set dok = CATIA.ActiveDocument
Set volym=dok.selection
Dim objtyp(0)
objtyp(0)="Pad"
msgbox ("select a pad")
status=volym.SelectElement(objtyp,"Select a Pad",true)
set ref1=volym.Item(1).value
status=volym.EndSelectElement()
GetVolume(ref1)
End Sub

I think that the argument for GetVolume (ref1) is the wrong data type

How do I use GetVolume?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor