Welcome to the COE Discussion Forum! 

 

To participate in the discussion forum, you must be logged in to the website.  If you forget your login information, please contact COE Headquarters at coe@coe.org or (800) 263-2255.

If you are new to the COE Discussion Forum and would like to participate, please register.


Register Today
COE 2009 Annual PLM Conference & TechniFair

COE DISCUSSION FORUM
Subject: Copying and pasting contents of background view

You are not authorized to post a reply.   
Author Messages
COE-FORUM-USER

10 Jun 2003 10:07 AM
Hi all,

I am trying to copy the contents of the background view and paste inside a new drawing.tried the following steps but couldn't get through.

Added the background view to the selection,copied the selection and tried to paste inside a new drawing.

I have given below the part of the code i am trying.

............

Dim DrawingView1 as DrawingView
Set DrawingView1 = DrawingViews.Item("Background View")

'I am adding the Background view of the already opened drawing to the selection

Dim MySelection as Selection
Set MySelection = CATIA.ActiveDocument.Selection

MySelection.Clear()
MySelection.Add(DrawingView1)
MySelection.Copy()

Dim documents1 As Documents
Set documents1 = CATIA.Documents

Dim newdrawingDocument As Document
Set newdrawingDocument = documents1.Add("Drawing")

newdrawingDocument.Standard = catISO

Dim drawingSheets1 As DrawingSheets
Set drawingSheets1 = newdrawingDocument.Sheets

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

drawingSheet1.PaperSize = catPaperA1

drawingSheet1.Orientation = catPaperLandscape

drawingSheet1.Scale = 1.000000

drawingSheet1.Activate

Dim DrawingViews1 As DrawingViews
Set DrawingViews1 = drawingSheet1.Views

Dim DrawingView1 as DrawingView
Set DrawingView1 = DrawingViews1.Item("Background View")

Set MySelection = CATIA.ActiveDocument.Selection

MySelection.Paste()


I am getting a error on the line of code where i am trying to Paste it.Could any one tell me the possible reason?

Thanks,
Guhan




Author: guhan
You are not authorized to post a reply.
Forums > COE Forums > CATIA V5 Programming > Copying and pasting contents of background view



ActiveForums 3.6

    

401 North Michigan Avenue, Chicago, IL 60611-4267 | (312) 321-5153 | (800) COE-CALL (U.S.)