Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set custom property from Property "Name" - Vault Data Standard

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
bruno.milano
425 Views, 2 Replies

Set custom property from Property "Name" - Vault Data Standard

Hi,

I have another problem with configuration of Data Standard.

 

I have one property called "Code" mapped on Autocad Title Block. This property is the File name without extension.

Exemple:

File Name: AAA1234.dwg

Code: AAA1234.

 

I would make sure that, when creating a file with Standard Data Vault Explorer, the "code" field is filled in automatically by reading the File Name property (_XLTN_FILE NAME) no extension.

I tried usig Help of data standard (create a function etc). But not run.

 

Cattura.JPG

 

Do you have any suggestion?

Thanks....

 

Bruno.

2 REPLIES 2
Message 2 of 3

Hi Bruno, the file name is generate only at the end, when you press the OK button. The function GetNewFile is called, present in the default.ps1 file. In taht function, you can add some lines of code that will populate your property like this:

 

function GetNewFileName
{
	$dsDiag.Trace(">> GetNewFileName")
	...
	..
	...
	
	$dsDiag.Trace("<< GetNewFileName $newfileName")
$Prop["Title"].Value = [System.IO.Path]::GetFileNameWithoutExtension($newfileName)
return $newfileName }

 in my example i have set the Title, but you can set which ever property you like. I guess it will be called Codice or similar.

Basically, i let the new file name to be generated and saved in tht evariable $newfileName, take only the file name and save into my property.

 

i hope this helps

ciao

marco

 

coolOrange
www.coolorange.com
Message 3 of 3

Thanks Marco,

very very valuable help.

I think i will many question to ask on this forum.

 

Thanks again.

Bruno

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report