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.


Forum Highlight: CATIA V6

 

Get Answers to Your V6 Questions
Dassault Systèmes answers user questions about CATIA V6.  Discuss these answers and propose new questions with end users from around the world in the CATIA V6 Forum.

COE DISCUSSION FORUM
Subject: Problem with getting definition and nomenclature of a drawing view reference document in VB

You are not authorized to post a reply.   
Author Messages
e_besp

07 Sep 2008 05:48 AM
Hello, everyone
 
I use a CATScript macro which fills the title block of a drawing with information (PartNumber, Definition, Nomenclature, Mass) taken from the reference model. This macro does it this way:
 
 Dim TextFrame1, TextFrame2, TextFrame3, TextFrame4 as String
Dim DrwSheet as DrawingSheet
 
Set DrwSheet = Catia.ActiveDocument.Sheets.ActiveSheet
 
TextFrame1 = DrwSheet.Views.Item("Front view".GenerativeBehavior.Document.PartNumber
TextFrame2 = DrwSheet.Views.Item("Front view".GenerativeBehavior.Document.Definition
TextFrame3 = DrwSheet.Views.Item("Front view".GenerativeBehavior.Document.Nomenclature
TextFrame4 = CStr(DrwSheet.Views.Item("Front view".GenerativeBehavior.Document.Analyze.Mass)
 
But now I’ve encountered problem with using this structure in VB6 program. In VB the line
 
Catia.ActiveDocument.Sheets.ActiveSheet.Views.Item("Front view".GenerativeBehavior.Document
 
returns object of AnyType class which has only .Application .GetItem .Name .Parent members and nothing more. I tried to use other methods and properties of Document class (such as .Path or .Fullname), but haven’t succeeded.
 
How do I retrieve the needed information of the “Front view” reference model in VB? Please help me….
e_besp

08 Sep 2008 01:59 PM

Found myself. In VB it is necessary to use the following construction:

Dim TextFrame1, TextFrame2, TextFrame3, TextFrame4 as String
Dim DrwSheet as DrawingSheet
 
Set DrwSheet = Catia.ActiveDocument.Sheets.ActiveSheet
 
TextFrame1 = DrwSheet.Views.Item("Front view".GenerativeBehavior.Document.Parent.Product.PartNumber
TextFrame2 = DrwSheet.Views.Item("Front view".GenerativeBehavior.Document.Parent.Product.Definition
TextFrame3 = DrwSheet.Views.Item("Front view".GenerativeBehavior.Document.Parent.Product.Nomenclature
TextFrame4 = CStr(DrwSheet.Views.Item("Front view".GenerativeBehavior.Document.Parent.Product.Analyze.Mass)
You are not authorized to post a reply.
Forums > COE Forums > CATIA V5 Programming > Problem with getting definition and nomenclature of a drawing view reference document in VB



ActiveForums 3.6

    

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