Last active
October 18, 2021 14:37
-
-
Save slydlake/659803880e71036014978444e1d363dd to your computer and use it in GitHub Desktop.
[Copy Modell Props to Drawing] #powershell #VDS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Bei Zeichnungen werden die Modell Eigenschaften der Vorlage kopiert | |
if ($Document.DocumentType -like "12292") { #entspricht kDrawingDocumentObject | |
CopyModelProperties | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function CopyModelProperties { | |
try{ | |
$refDocFull = $Application.ActiveDocument.ReferencedDocuments[1] | |
$Prop["Description"].Value = $refDocFull.PropertySets.Item("Design Tracking Properties").Item("Description").Value | |
$PropsUserDef = $refDocFull.PropertySets.Item("Inventor User Defined Properties") | |
$Prop["AIMD_DESCRIPTION"].Value = $PropsUserDef.Item("AIMD_DESCRIPTION").Value | |
$Prop["AIMD_ORIGIN"].Value = $PropsUserDef.Item("AIMD_ORIGIN").Value | |
$Prop["EPL_VERWENDUNG"].Value = $PropsUserDef.Item("EPL_VERWENDUNG").Value | |
$Prop["EPL_SHORT_DESC_ENG"].Value = $PropsUserDef.Item("EPL_SHORT_DESC_ENG").Value | |
$Prop["EPL_HALBZEUG"].Value = $PropsUserDef.Item("EPL_HALBZEUG").Value | |
$Prop["EPL_Ersetzt_durch"].Value = $PropsUserDef.Item("EPL_Ersetzt_durch").Value | |
$Prop["EPL_Ersatz_Fuer"].Value = $PropsUserDef.Item("EPL_Ersatz_Fuer").Value | |
#$refDocProp = $Document.PropertySets.Item("Inventor Document Summary Information") Inventor User Defined Properties | |
#$Prop["Description"].Value = $refDocProp.Item("Description").Value | |
#$dsDiag.Inspect() | |
} | |
catch{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment