Getting a name scheme automaticly for iam files with data standard

Getting a name scheme automaticly for iam files with data standard

erasarnova
Enthusiast Enthusiast
659 Views
5 Replies
Message 1 of 6

Getting a name scheme automaticly for iam files with data standard

erasarnova
Enthusiast
Enthusiast

Hi,

We installed data standard and i created a custom category, then set a rule that if file extention is iam. Then we set a name scheme same as custom category.

What we aim is when we create an iam file we would like to see a default name scheme just for iam files. So we would like to see if it is an iam file when we are saving, it should pop up as our New custom category selected with its name scheme. But what happens is Engineering category shows up as default and if we save it as is, it becomes back to our custom category inside vault but with Engineering category name scheme.

So There are 2 problems, we need to see our iam file category as default when we are saving iam files on data standard saving window. 

Even if we can make it somehow, default category won't pick its name scheme on window pop up inside inventor. We need to select something else first then it gets name schemes.

 

Can you help us on this please? If we can make this that would be very easy to use.

0 Likes
Accepted solutions (2)
660 Views
5 Replies
Replies (5)
Message 2 of 6

gandhey
Autodesk
Autodesk
Accepted solution

Hello,

 

You need to customize the data standard .ps 1 file to suit to your needs. 

  • Copy the Default.ps1 (from "C:\ProgramData\Autodesk\Vault 2020\Extensions\DataStandard\CAD\addins" to C:\ProgramData\Autodesk\Vault 2021\Extensions\DataStandard\CAD.Custom\addins")
  • You may want to just rename .ps1 in .custom folder.
  • to pick the category for assembly files by default (instead of engineering) --> eg : here my category name for iam files is 'AsmCategory.
    • Add following in the function InitializeCategory()
      {
      if ($Prop["_FileExt"].Value -eq ".IAM")
      {
      $Prop["_Category"].Value = "AsmCategory"
      }
  • To pick the numbering scheme for the category for iam files by default (eg : 'new1' is the numbering scheme name for 'AsmCategory'
  • please add this in function InitializeNumSchm() below if($numSchm)
    • elseif ($Prop["_Category"].Value -eq "AsmCategory"){
      $Prop["_NumSchm"].Value = "new1"
      }

 

Hope this helps.

 

Regards,

Yogeshwar

(Vault team)

0 Likes
Message 3 of 6

erasarnova
Enthusiast
Enthusiast

So for first one there is a fuction in there:

function InitializeCategory()
{
if ($Prop["_CreateMode"].Value)
{
if (-not $Prop["_SaveCopyAsMode"].Value)
{
$Prop["_Category"].Value = $UIString["CAT1"]
}
}
}

Do i delete them then replace the code provided by you?

0 Likes
Message 4 of 6

erasarnova
Enthusiast
Enthusiast

It is still not showing up my "Montaj" custom category when saving an iam file inside of inventor. This is the current code where edits happened in custom cad:

 

function InitializeCategory()
{
if ($Prop["_CreateMode"].Value)
{
if (-not $Prop["_SaveCopyAsMode"].Value)
{
$Prop["_Category"].Value = $UIString["CAT1"]
{
if ($Prop["_FileExt"].Value -eq ".IAM")
{
$Prop["_Category"].Value = "Montaj"
}
}
}
}
}

 

 

------

 

 

function InitializeNumSchm()
{
#Adopted from a DocumentService call, which always pulls FILE class numbering schemes
$global:numSchems = @($vault.NumberingService.GetNumberingSchemes('FILE', 'Activated'))
if ($Prop["_CreateMode"].Value)
{
if (-not $Prop["_SaveCopyAsMode"].Value)
{
$Prop["_Category"].add_PropertyChanged({
if ($_.PropertyName -eq "Value")
{
$numSchm = $numSchems | where {$_.Name -eq $Prop["_Category"].Value}
if($numSchm)
{
$Prop["_NumSchm"].Value = $numSchm.Name
}
elseif ($Prop["_Category"].Value -eq "Montaj"){
$Prop["_NumSchm"].Value = "Montaj"
}
}
})
}
else
{
$Prop["_NumSchm"].Value = "None"
}
}
}

 

Did i do something wrong here?

 

@gandhey 

0 Likes
Message 5 of 6

gandhey
Autodesk
Autodesk
Accepted solution

Hello,

 

Please comment out the existing 'if' loop and then add the suggested code.

VDS_Category.png 

 

Regards,

Yogeshwar

(Vault team)

0 Likes
Message 6 of 6

erasarnova
Enthusiast
Enthusiast

@gandhey 

 

One last thing, on this code we basicly say if extention value is something, then get this category and numbering scheme.

 

My question is this; can i make this like, if some specific iproperty have this value, then make file this category and numbering scheme.

 

This logic would help very much. Basicly what can i write in code instead of "extention value"?

0 Likes