Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Parameters scan

Status
Not open for further replies.

Pharys

Aerospace
Jul 29, 2015
15
0
0
GB
Hi everyone,

So I create this :

[sup]If oBodies.Count > 0 Then
Dim m As Integer
For m = 1 To oBodies.Count
If oBodies.Item(m).Name = sHybridBodyName Then
MsgBox "It appears the geometrical set that this macro creates already exists in the part. Unable to proceed.", vbCritical, "Error"
Exit Sub
End If
Next
End If[/sup]

And I would like to know if I can apply it for parameters.. More precisiely, like this :

[sup]
If oPart.Parameters.Count > 0 Then
Dim n As Integer
For n = 1 To oPart.Parameters.Count
If oPart.Parameters.Item(n).Name = "`Extraction point`" Then
MsgBox "It appears the extraction point parameters that this macro creates already exists in the part. Unable to proceed.", vbCritical, "Error"
Exit Sub
End If
Next
End If[/sup]

For the moment it doesn't work. My macro proceed but nothing happen when it comes to check if the parameters exists. Any advice would be great.

Thanks to all,
Pharys

PS: I am learning VBA scripting with CATIA since one week, sorry if my questions seems obvious :)
 
Replies continue below

Recommended for you

I found the problem !!! It's because there is a space in my parameter name... As I cannot change it, is it possible to "force" the scan ?

Thanks again,
Pharys
 
I was wrong !!! It wasn't because of the space ....

The things I had to do was to go deeper in the tree and now it works !

If anyone need help on it, please contact me :)

Byee
 
Status
Not open for further replies.
Back
Top