Professional Documents
Culture Documents
1 of 3
http://www.coe.org/p/fo/et/thread=23024
Jul 02
2010
How can I replace the "Background View" ?
Jinil Kim
[Nara Mold
& Die]
Dear all!
How can I replace the "Background View"?
I always do
"Page Setup"-> Change "Sheet Style" --> "Insert Background View" --> "Browse" -->
Search my template drawing (A4,A3,A2,A1....) --> "Insert" --> O.K.
I recorded that process in to macro but the record was nothing...
Please help me!
Attachments
00002.jpg (40k)
Xavier
Klein
[Staubli]
Jinil Kim
[Nara Mold
& Die]
Hello,
If you have a few specific Template File with cartridge and so ...
I advise you to write a short Macro with
CATIA.Documents.NewFrom (MyTemplateDrawFile)
Dear X.KLEIN
I know the "Newfrom" function.
I can not use that, because I had already created some views and dimensions.
After creating all components(views,dimensions, etc.), sometimes the paper size was too small or too big.
So, I need to change the papersize and background view(title box) --> every paper size has different title box.
Best Regards!
Jinil
Xavier
Klein
[Staubli]
Hello,
here is the way that I manage cartridge with a macro
1) all the cartridge frame is define in one Drawing DETAIL
2) all text from cartridge are define witha specific name : cartridge_title_1 , cartridge_reference , cartridge_date .....
3) according Cartridge size , position HV of each text is define in a TablePosition (TextName, , CartridgeFormat, Position_H , Position_V ,
Size)
4) when I change cartridge size :
- I replace in the background view Cartridge_Detail_A1 by Cratridge_Detail_A0
- update position of each Text with TablePosition
This take a few Time , to fill TablePosition for each text , but the code to do it is very basic !
11-02-2014 12:42
2 of 3
Xavier
Klein
http://www.coe.org/p/fo/et/thread=23024
[Staubli]
here is a sample code , to replace the Detail from the Background view :
Sub DeleteCartouche()
Set CATIA = GetObject(, "CATIA.Application")
'1) Ouverture du Model avec le cartouche
Set MyDraw = CATIA.ActiveDocument
Dim MySheet As DrawingSheet
Dim view_car As DrawingView
Dim i As Integer
Dim j As Integer
For i = 1 To MyDraw.Sheets.Count
Set MySheet = MyDraw.Sheets.Item(i)
If MySheet.IsDetail Then
GoTo LaSuite
End If
Set view_car = MySheet.Views.Item(2)
For j = 1 To view_car.Components.Count
If Left(view_car.Components.Item(j).Name, 2) = Left(MySheet.PaperName, 2) Then
view_car.Components.Remove (j)
GoTo prochainevue
End If
Next j
prochainevue:
Dim NbText As Integer
NbText = view_car.Texts.Count
For j = NbText To 1 Step -1
If Left(view_car.Texts.Item(j).Name, 10) = "Texte.car_" Then
view_car.Texts.Remove (j)
End If
Next j
LaSuite:
Next i
Call ModuleCartouche.CreerParametre("", "cartouche")
End Sub
11-02-2014 12:42
3 of 3
http://www.coe.org/p/fo/et/thread=23024
11-02-2014 12:42