Indexes
o Property Cameras( | ) As (Read Only) |
Dim CameraCollection As Cameras Set CameraCollection = Doc.Cameras
o Property CurrentFilter( | ) As |
Doc.CurrentFilter = "Filter001"
o Property CurrentLayer( | ) As |
Doc.CurrentLayer = "Layer 3"
o Property FullName( | ) As (Read Only) |
DocFullName = Doc.FullNameThe returned value is like this:
e:\users\psr\Parts\MyNicePart.CATPart
o Property Path( | ) As (Read Only) |
DocPath = Doc.PathThe returned value is like this:
e:\users\psr\Parts
o Property ReadOnly( | ) As (Read Only) |
IsReadOnly = Doc.ReadOnly
o Property Saved( | ) As (Read Only) |
HasChanged = NOT Doc.Saved
o Property SeeHiddenElements( | ) As |
Doc.SeeHiddenElements = True
o Property Selection( | ) As (Read Only) |
Dim CurSel As Selection Set CurSel = Doc.Selection
o Sub Activate( | ) |
Doc.Activate()
o Sub Close( | ) |
Doc.Close()
o Sub CreateFilter( | iFilterName, | |
iFilterDefinition) |
Doc.CreateFilter ("Filter001", "layer= 2 & layer= 1")
o Func CreateReferenceFromName( | iLabel) As |
o Sub ExportData( | fileName, | |
format) |
Doc.ExportData("IGESDoc", "igs")
o Func GetWorkbench( | workbenchName) As |
Doc.GetWorkbench("Structural")
o Func Indicate2D( | iMessage, | |
ioDocumentWindowLocation) As |
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( | iPlanarGeometricObject, | |
iMessage, | ||
ioWindowLocation2D, | ||
ioWindowLocation3D) As |
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 |
Dim MyWindow As Window Set MyWindow = Doc.NewWindow()
o Sub RemoveFilter( | iFilterName) |
Doc.RemoveFilter ("Filter001")
o Sub SaveAs( | fileName) |
Doc.SaveAs("NewName")
o Sub Save( | ) |
Doc.Save()
Copyright © 2006, Dassault Systèmes. All rights reserved.