HollopETER
Mechanical
- Aug 7, 2014
- 3
HEllo!
I am a bit new at this site, but I have read a lot of forums here. I have learnt a lot!!! Thank you!
I have a problem what I couldnt fix.
I am using Catia, and trying to create a macro, creating me a template. I am using VBA!
My problem is that i cannot create a link between the text and the parts property. I mean eg.: drawing number, designer, date etc...
Can somebody help me to fix this problem? Now I can open the drawn template, and there are the texts which should be connected to the part/product.
I tried making attribute unsuccesfully..
Help me please!
here is my code:
----------------------------------------------------------------------------------------------
Option Explicit
' Purpose: Creating a template
' Assumptions: Looks for 1.CATDrawing in the DocView
' Author: johndoe
' Languages: VBScript
' Locales: English
Sub CATMain()
' Open the Drawing document
'("C:\Users\johndoe\Desktop\catia\visualbasicad\1.CATDrawing") should be replaced to the right directory
Dim oDoc As Document
Set oDoc = CATIA.Documents.Open("C:\Users\johndoe\Desktop\catia\visualbasicad\1.CATDrawing")
' ------------
' Get the sheets collection of the drawing
' ------------
Dim oDrawingSheets As DrawingSheets
Set oDrawingSheets = oDoc.Sheets
' ------------
' Add the created sheet
' ------------
Dim oDrawingSheet As DrawingSheet
Set oDrawingSheet = oDrawingSheets.Item("Sheet.1")
' ------------
' Activate the sheet
' ------------
oDrawingSheet.Activate
End Sub
----------------------------------------------------------------------------------------
I am a bit new at this site, but I have read a lot of forums here. I have learnt a lot!!! Thank you!
I have a problem what I couldnt fix.
I am using Catia, and trying to create a macro, creating me a template. I am using VBA!
My problem is that i cannot create a link between the text and the parts property. I mean eg.: drawing number, designer, date etc...
Can somebody help me to fix this problem? Now I can open the drawn template, and there are the texts which should be connected to the part/product.
I tried making attribute unsuccesfully..
Help me please!
here is my code:
----------------------------------------------------------------------------------------------
Option Explicit
' Purpose: Creating a template
' Assumptions: Looks for 1.CATDrawing in the DocView
' Author: johndoe
' Languages: VBScript
' Locales: English
Sub CATMain()
' Open the Drawing document
'("C:\Users\johndoe\Desktop\catia\visualbasicad\1.CATDrawing") should be replaced to the right directory
Dim oDoc As Document
Set oDoc = CATIA.Documents.Open("C:\Users\johndoe\Desktop\catia\visualbasicad\1.CATDrawing")
' ------------
' Get the sheets collection of the drawing
' ------------
Dim oDrawingSheets As DrawingSheets
Set oDrawingSheets = oDoc.Sheets
' ------------
' Add the created sheet
' ------------
Dim oDrawingSheet As DrawingSheet
Set oDrawingSheet = oDrawingSheets.Item("Sheet.1")
' ------------
' Activate the sheet
' ------------
oDrawingSheet.Activate
End Sub
----------------------------------------------------------------------------------------