×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

how can I uncover Axis system

how can I uncover Axis system

how can I uncover Axis system

(OP)
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

RE: how can I uncover Axis system

Try this:

CODE --> CATVBA

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

RE: how can I uncover Axis system

(OP)
Unfortunately It does not work on R21.

RE: how can I uncover Axis system

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

RE: how can I uncover Axis system

(OP)
There is no error massage sad

RE: how can I uncover Axis system

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

RE: how can I uncover Axis system

(OP)
I ran this macro step by step, and on the line 3 when I select part nothing is happening.

RE: how can I uncover Axis system

CODE --> CATVBS

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

https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...

RE: how can I uncover Axis system

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

RE: how can I uncover Axis system

(OP)
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.

RE: how can I uncover 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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources