Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Macro to reposition the views..

Status
Not open for further replies.

Rangraop

Automotive
Mar 19, 2014
21
0
0
US
Hello All,

I am wondering to create two macros. one will record position of all views in a drawing may be in the form of co ordinate values.
When we update the views there is possibility of Views movement to some random locations. I would like to create second macro that will
use recorded View positions and reposition all the views to their original location..

Can anybody help me doing this..

I started with this..

********************
Language="VBSCRIPT"

Sub CATMain()

Dim drawingDocument1 As Document
Set drawingDocument1 = CATIA.ActiveDocument

Dim drawingSheets1 As DrawingSheets
Set drawingSheets1 = drawingDocument1.Sheets

Dim drawingSheet1 As DrawingSheet
Set drawingSheet1 = drawingSheets1.Item("Sheet.1")

Dim drawingViews1 As DrawingViews
Set drawingViews1 = drawingSheet1.Views

Dim drawingView1 As DrawingView
Set drawingView1 = drawingViews1.Item("FRONT VIEW")

drawingView1.x = 303.539276

drawingView1.y = 390.757721

End Sub
*********************
This script will reposition the view, However I want to use this for number of views in multiple drawings..
Let me know if anybody requires more info to understand this...

Thank you,
Rangrao Padiyar
 
Status
Not open for further replies.
Back
Top