A small
example for setting the import path of an item (using pdmProxyPdmDocumentI).
Create a
VBS filter node
directly after the Konvertierungsservice (meaning before the converter has been processed). Set
VBS file
(plugin_template.vbs) and
VB Class
(_AfterConversion).
Go to the function „AfterConversion“
Add the following lines of code:
dim docProp = item.GetPropertiesObject()
dim pathProp = Application.GetObject("pdmProxies.ObjectFactory").createPdmProxiesObject
("pdmProxyPropertyObjectC", "Testpath/test")
pathProp.setType("STRING")
docProp.setProperty("path",pathProp)
Get the root properties object (Return value pdmProxyAttributeContainerC)
dim docProp = item.GetPropertiesObject()
Create new pdmProxyPropertyObjectC & setValue and Type
dim pathProp = Application.GetObject("pdmProxies.ObjectFactory").
createPdmProxiesObject("pdmProxyPropertyObjectC", "Testpath/test")
pathProp.setType("STRING")
Add pdmProxyPropertyObjectC to pdmProxyAttributeContainerC
docProp.setProperty("path",pathProp)
The
converter.vbs
(processed
during AttributeMapper) converts this attribute „path“ to
a classification of the product.
| In classification: |
"Name": "path",
"Group": "document",
"Value": {
"Text": "Testpath/test"
},
"Id": "path"
},
|
Edit Structure Node in PARTdataCenter
Document Path: $document::path.
(Group: document; Name: path --> see Classification PARTdataCenter)
Depending on which function is used in the code, the proper group has to be chosen in the Structure Node:
dim docProp =
item.GetPropertiesObject() -->
Mapping of functions to groups:
| GetPropertiesObject() | --> document |
| GetFileProperties() | --> file |
| GetCadAttributes() | --> cad |
| GetCadDimensions() | --> dimension |
| GetPdmAttributes() | --> pdm |
| GetCustomAttributes() | --> custom |