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 can I uncover Axis system

Status
Not open for further replies.

Santa123

Mechanical
Oct 2, 2006
80
PL
Hi,

I have Product with Parts and I want to select Part to uncover the Axis system. Unfortunately it does not work.

Sub CATMain()
Dim oSel As Selection
Set oSel = CATIA.ActiveDocument.Selection
oSel.Search "type:Axis System"
oSel.VisProperties.SetShow 0
oSel.Clear

End Sub

Best Regards
Santa
 
Replies continue below

Recommended for you

Try this:
Code:
Sub CATMain()
Dim oSel As Selection
Set oSel = CATIA.ActiveDocument.Selection
oSel.Clear

oSel.Search ("'Part Design'.'Axis System'.Visibility=Visible, all")

Dim visprop As VisPropertySet
Set visprop = oSel.VisProperties

visprop.SetShow catVisPropertyNoShowAttr
oSel.Clear

End Sub

Eric N.
indocti discant et ament meminisse periti
 
sorry I am still on R20.

What is the error message?

This script will actually hide all visible axis.

to do the opposite you will have to modify the .search .setshow lines


Eric N.
indocti discant et ament meminisse periti
 
run it step by step (F8) and check if it is the selection of axis or the noshow that does not work.

try with a new product with one or more catpart with axis in show

Eric N.
indocti discant et ament meminisse periti
 
I ran this macro step by step, and on the line 3 when I select part nothing is happening.
 
Code:
Sub CATMain()

Set productDocument1 = CATIA.ActiveDocument
Set product1 = productDocument1.Product
product1.ApplyWorkMode DEFAULT_MODE

Set selection1 = productDocument1.Selection
selection1.Search "Name=*Axis System,all"
Set visPropertySet1 = selection1.VisProperties
visPropertySet1.SetShow catVisPropertyShowAttr
selection1.Clear 

Set V3D = Catia.ActiveDocument.Cameras.item(1).Viewpoint3D
Catia.ActiveWindow.ActiveViewer.Viewpoint3D = V3D

End Sub

Regards
Fernando

 
line 3 set oSel does not select anything... it just define oSel as the curent selection
Line 4 unselect all
line 6 oSel.search should select all visible axis
line 11 .setshow put selection in noshow

Let us know what does not work as expected

Eric N.
indocti discant et ament meminisse periti
 
Thanks a lot for reply, probably I wasn't clear enough.
I have an opened Product with a lot of Parts. From the level of Product I need to select (in main window, not tree) any Part to uncover the Axis system.
 
well, from the scripts you were given, it should not be too difficult to modify them to get the result you need.

You should enjoy the opportunity to learn a bit of VBA with your request.

keep us posted of your progress, we'll help you.

tips: from my script you need to avoid clearing the selection at the beginning and you need to tell the .search to look only in preselected element. The online doc should help you with that.

you can do it

Eric N.
indocti discant et ament meminisse periti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top