Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Projection view links catia

Status
Not open for further replies.

vjxzy

Automotive
Jan 31, 2019
13
thread560-158226

Hi i need a solution for a problem.
Problem - when i copy front view and its Projection view (Top, bottom, sides)from sheet1 and paste it to sheet 2 links between front and projection views will be lost is there any option to link the projection views to front view so that when i move the front view all the projections vies will also move with it.

 
Replies continue below

Recommended for you

Hi,

here a small code that links the positions of each view :
1.front view must be active
2.align manually the views if they are disaligned

Code:
Sub CATMain()
'***********************************************************
'***            Macro de réalignement des vues           ***
'***         V00 du 04/02/2016 de Marc Litzler           ***
'***         Activer la vue de face                      ***
'***     Repositionner les vues à l'aide d'éléments      ***
'***               Lancer la macro                       ***
'***********************************************************


 ' Vérifie si le document actif est un CATDrawing

Dim MonDessin As Document
On Error Resume Next
 Set MonDessin = CATIA.ActiveDocument
   If (Err.Number <> 0) Then
      MsgBox ("Un CATDrawing doit être actif")
      Exit Sub
   End If
   On Error GoTo 0
   
  If (InStr(MonDessin.Name, ".CATDrawing")) = 0 Then
   MsgBox ("La fenêtre active doit être un CATDrawing")
   Exit Sub
 End If
 
Set sheets1 = MonDessin.Sheets
Set s1 = sheets1.ActiveSheet
Set vcoll = s1.Views
Set v1 = vcoll.ActiveView
 nbview = vcoll.Count

For i = 1 To nbview
    If (vcoll.Item(i).Name <> v1.Name And vcoll.Item(i).Name <> "Main View" And vcoll.Item(i).Name <> "Background View") Then
        If MsgBox("Align " & vcoll.Item(i).Name & " with " & v1.Name, vbYesNo) = vbYes Then
            vcoll.Item(i).ReferenceView = v1
            vcoll.Item(i).AlignedWithReferenceView
        End If
    End If
Next i


End Sub

Regards
Marc
 
thanks, Marc I will check this out.
 
THOUSAND Thanks, Marc but I still need to learn how this is working can u explain [thumbsup2][glasses]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor