×
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

change view

change view

change view

(OP)
hi guys

I am having trouble creating a macro

here is the thing, I have a surface selected, then I colored it, and I wanted to take a picture, but sometimes the face is hided,

what I need to know is, if there is a way to change the view of my part by the selected surface,

like when you do it manually, select surface, click under normal view and it rotates.

hope you can understand my issue.

thank you so much for your help

RE: change view

Once you select the surface through macro
use
CATIA.StartCommand "Normal View"

This will make the surface selected normal to your screen.

Regards,
Maddy

RE: change view

(OP)
Maddy02 thankyou for your answer,

when I apply the command in my macro it only works the first time, and do not colored the surface selected, hope you can help me with this issue, thanks

Sub CATmain()

'**************************COLOREA CARA*****************************
Dim visProperties1 As VisPropertySet
Dim icnt As Integer
Dim MySurface As Variant
Dim MySelection As Selection
Dim i

CATIA.ActiveDocument.Selection.Clear
Set objsel = CATIA.ActiveDocument.Selection
objsel.Search "Type=Topology.Face,all"
icnt = objsel.Selection.Count
ReDim MySurface(icnt + 1)

For i = 1 To icnt
Set MySurface(i) = objsel.Item(i).Value
Next i

For i = 1 To icnt
CATIA.ActiveDocument.Selection.Clear
CATIA.ActiveDocument.Selection.Add (MySurface(i))
CATIA.StartCommand "Normal View"
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
CATIA.ActiveDocument.Selection.VisProperties.SetRealColor 255, 0, 0, 1

For j = 1 To icnt
If j <> i Then
CATIA.ActiveDocument.Selection.Clear
CATIA.ActiveDocument.Selection.Add (MySurface(j))
Set visProperties1 = CATIA.ActiveDocument.Selection.VisProperties
CATIA.ActiveDocument.Selection.VisProperties.SetRealColor 255, 255, 255, 1
End If
Next
CATIA.ActiveDocument.Selection.Clear

RE: change view

(OP)
I found another way to doit instead of the solid, thank you very much

is there a way to change the edges color in a macro? a found how to change the background, the selection lines but the edges I cant do it

hope you can help me, thank you

RE: change view

(OP)
ferdo: thank you so much for your answer,

well, I will look for a combination of color that best show what I need,

thank you so much for your help and time

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