Create new file

This function create a new “3DShape” and assign the according window to a variable [Typ: Window]. The variables “MyEditor” and “MyPart” are assigned to the new editor and the new part.

Public Function CreateNewFileAndSetWindow(ByRef MyEditor As Editor, ByRef MyPart As Part) As Window
    Dim MyService As PLMNewService
    
    Set MyService = CATIA.GetSessionService("PLMNewService")
    MyService.PLMCreate "3DShape", MyEditor
    Set CreateNewFileAndSetWindow = CATIA.ActiveWindow
    Set MyPart = MyEditor.ActiveObject    
End Function

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

+ 23 = 27

Open File

 

' Get the Search service objekt
    Dim MySearchService As Service
    Set MySearchService = CATIA.GetSessionService("PLMSearch")

' Instantiate PLMSearch
    Dim MyPLMSearch 'As SearchService
    Set MyPLMSearch = MySearchService.Searches.Add

' Set type of object to query, a criterium and trigger
    MyPLMSearch.Type = "VPMReference"
    MyPLMSearch.AddAttributeCriteria "V_Name", MyFile
    MyPLMSearch.Search

' retrieve the listed entities
    Dim MyPLMEntities As PLMEntities
    Set MyPLMEntities = MyPLMSearch.EditedContent

' get the PLMOpen and Open the first Doc
    Dim MyPLMOpenService As Service
    Set MyPLMOpenService = CATIA.GetSessionService("PLMOpenService")
    MyPLMOpenService.PLMOpen MyPLMEntities.Item(1), MyEditor

 

Save file

Public Sub SaveFile(MyEditor As Editor)
    Dim MyPLMService As PLMPropagateService
    Set MyPLMService = MyEditor.GetService("PLMPropagateService")
    
    MyPLMService.Save
End Sub

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

84 + = 92

PLM Attributes

Attributes Name for VBA
Applicability Date V_ApplicabilityDate
Applicable in Projects V_ProjectApplicability
Is Last Version V_isLastVersion
Is Terminal V_isTerminal
Is PLM Controlled V_isVPLMControlled
Maturity V_maturity
Version V_version
policy policy
Creation date C_created
Last modification C_modified
Is Locked LOCKSTATUS
Lock Owner LOCKUSER
Name PLM_ExternalID
Customer Discipline V_CustoDiscipline
Definition V_Name
Description V_description
Discipline V_discipline
Nature V_nature
Organization V_organization
Project V_project
Security Level V_sec_level
Usage V_usage
Responsible V_user

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

7 + 1 =