PSI-CAD
Computer
- Feb 13, 2009
- 997
Hi
I succeed to create a user exit for file open and file new, and put a code to import a catalogue for attribut
It works but I encountered the problem that it doesn't work if I have no part in my session
Because, I need to define the workpart and the displayed part
Is there any setting to get the creation of the file before my code execution ?
[pre] Function ufcre() As Integer
Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display
' ----------------------------------------------
' Importation du catalogue concepteur
' ----------------------------------------------
Dim attributeTemplatesBuilder1 As NXOpen.AttributeTemplatesBuilder = workPart.PropertiesManager.CreateAttributeTemplatesBuilder()
attributeTemplatesBuilder1.Templates = NXOpen.AttributeTemplatesBuilder.TemplatesOptions.Catalog
attributeTemplatesBuilder1.CatalogFilename = c:\temp\catalogue_CONCEPTEURS.xml"
attributeTemplatesBuilder1.ImportCatalog()
' ----------------------------------------------
' Importation du catalogue désignation
' ----------------------------------------------
attributeTemplatesBuilder1.CatalogFilename = JANUS_ADD_PLAQUE_MENU_TEMPLATE_DIR + "\catalogue_designation.xml"
attributeTemplatesBuilder1.ImportCatalog()
attributeTemplatesBuilder1.Destroy()
End Function
[/pre]
Thanks in advance
Regards
Didier Psaltopoulos
I succeed to create a user exit for file open and file new, and put a code to import a catalogue for attribut
It works but I encountered the problem that it doesn't work if I have no part in my session
Because, I need to define the workpart and the displayed part
Is there any setting to get the creation of the file before my code execution ?
[pre] Function ufcre() As Integer
Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display
' ----------------------------------------------
' Importation du catalogue concepteur
' ----------------------------------------------
Dim attributeTemplatesBuilder1 As NXOpen.AttributeTemplatesBuilder = workPart.PropertiesManager.CreateAttributeTemplatesBuilder()
attributeTemplatesBuilder1.Templates = NXOpen.AttributeTemplatesBuilder.TemplatesOptions.Catalog
attributeTemplatesBuilder1.CatalogFilename = c:\temp\catalogue_CONCEPTEURS.xml"
attributeTemplatesBuilder1.ImportCatalog()
' ----------------------------------------------
' Importation du catalogue désignation
' ----------------------------------------------
attributeTemplatesBuilder1.CatalogFilename = JANUS_ADD_PLAQUE_MENU_TEMPLATE_DIR + "\catalogue_designation.xml"
attributeTemplatesBuilder1.ImportCatalog()
attributeTemplatesBuilder1.Destroy()
End Function
[/pre]
Thanks in advance
Regards
Didier Psaltopoulos