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!

change view

Status
Not open for further replies.

lapek

Aerospace
Aug 26, 2013
37
MX
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
 
Replies continue below

Recommended for you

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

This will make the surface selected normal to your screen.

Regards,
Maddy

 
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
 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top