All Frameworks Object Hierarchy This Framework Previous Next Indexes
IUnknown | +---IDispatch | +---CATBaseUnknown | +---CATBaseDispatch | +---AnyObject | +---Document
o Property Cameras( | ) As CATIACameras (Read Only) |
Dim CameraCollection As Cameras Set CameraCollection = Doc.Cameras
o Property CurrentFilter( | ) As CATBSTR |
Doc.CurrentFilter = "Filter001"
o Property CurrentLayer( | ) As CATBSTR |
Doc.CurrentLayer = "Layer 3"
o Property FullName( | ) As CATBSTR (Read Only) |
DocFullName = Doc.FullNameThe returned value is like this:
e:\users\psr\Parts\MyNicePart.CATPart
o Property Path( | ) As CATBSTR (Read Only) |
DocPath = Doc.PathThe returned value is like this:
e:\users\psr\Parts
o Property ReadOnly( | ) As boolean (Read Only) |
IsReadOnly = Doc.ReadOnly
o Property Saved( | ) As boolean (Read Only) |
HasChanged = NOT Doc.Saved
o Property SeeHiddenElements( | ) As boolean |
Doc.SeeHiddenElements = True
o Property Selection( | ) As CATIASelection (Read Only) |
Dim CurSel As Selection Set CurSel = Doc.Selection
o Sub Activate( | ) |
Doc.Activate()
o Sub Close( | ) |
Doc.Close()
o Sub CreateFilter( | CATBSTR | iFilterName, |
CATBSTR | iFilterDefinition) |
Doc.CreateFilter ("Filter001", "layer= 2 & layer= 1")
o Func CreateReferenceFromName( | CATBSTR | iLabel) As CATIAReference |
o Sub ExportData( | CATBSTR | fileName, |
CATBSTR | format) |
Doc.ExportData("IGESDoc", "igs")
o Func GetWorkbench( | CATBSTR | workbenchName) As CATIAWorkbench |
Doc.GetWorkbench("Structural")
o Func Indicate2D( | CATBSTR | iMessage, |
CATSafeArrayVariant | ioDocumentWindowLocation) As CATBSTR |
Set Document = CATIA.ActiveDocument : Set Selection = Document.Selection : Set DrawingSheets = Document.Sheets Set DrawingSheet = DrawingSheets.ActiveSheet : Set DrawingViews = DrawingSheet.Views Set DrawingView = DrawingViews.ActiveView : Set DrawingTexts = DrawingView.Texts 'We propose to the user that he specify a location in the drawing window Dim DrawingWindowLocation(1) Status=Document.Indicate2D("select a location into the drawing window",DrawingWindowLocation) if (Status = "Cancel") then Exit Sub Set DrawingText=DrawingTexts.Add("Hello world",DrawingWindowLocation(0),DrawingWindowLocation(1))
o Func Indicate3D( | CATIABase | iPlanarGeometricObject, |
CATBSTR | iMessage, | |
CATSafeArrayVariant | ioWindowLocation2D, | |
CATSafeArrayVariant | ioWindowLocation3D) As CATBSTR |
Set Document = CATIA.ActiveDocument : Set Part = Document.Part : Set Selection = Document.Selection Set HybridShapeFactory = Part.HybridShapeFactory Set HybridShapePlane = Part.Bodies.Item("PartBody").HybridShapes.Item("Plane.1") Set PlaneReference = Part.CreateReferenceFromObject(HybridShapePlane) 'We propose to the user that he select a location in the window ReDim WindowLocation2D(1),WindowLocation3D(2) Status=Document.Indicate3D(HybridShapePlane,"select a location in the document window", _ WindowLocation2D,WindowLocation3D) if (Status = "Cancel") then Exit Sub Set HybridShapePointOnPlane = HybridShapeFactory.AddNewPointOnPlane( _ PlaneReference,WindowLocation2D(0),WindowLocation2D(1)) Part.Bodies.Item("PartBody").InsertHybridShape HybridShapePointOnPlane Part.InWorkObject = HybridShapePointOnPlane Part.Update
o Func NewWindow( | ) As CATIAWindow |
Dim MyWindow As Window Set MyWindow = Doc.NewWindow()
o Sub RemoveFilter( | CATBSTR | iFilterName) |
Doc.RemoveFilter ("Filter001")
o Sub Save( | ) |
Doc.Save()
o Sub SaveAs( | CATBSTR | fileName) |
Doc.SaveAs("NewName")
Copyright © 2003, Dassault Systèmes. All rights reserved.