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!

Catia VBA macro programming. Export PRT properties to drawing file. Creating template

Status
Not open for further replies.

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
----------------------------------------------------------------------------------------
 
Replies continue below

Recommended for you

First create the parameters in part/product. then link the drawing texts with those params
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor