Copy Prompted Entries to Drawing custom iproperties

Copy Prompted Entries to Drawing custom iproperties

johan.degreef
Advisor Advisor
582 Views
4 Replies
Message 1 of 5

Copy Prompted Entries to Drawing custom iproperties

johan.degreef
Advisor
Advisor

I want each timle the titleblock is updated, to copy the prompted entries from the tilteblockto the drawing custom iproperties. I have have found this code and modified it to my naming scheme, but they don't get copied. Can anyone point me in the right direction?

 

On Error Resume Next
'https://www.cadlinecommunity.co.uk/hc/en-us/articles/203292761
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Dim oPromptEntry

Dim oCurrentSheet
oCurrentSheet = oDoc.ActiveSheet.Name

i = 1
For Each oSheet In oDoc.Sheets
  'i = i+1
  ThisApplication.ActiveDocument.Sheets.Item(i).Activate
       oTitleBlock=oSheet.TitleBlock
    oTextBoxes=oTitleBlock.Definition.Sketch.TextBoxes
    For Each oTextBox In oTitleBlock.Definition.Sketch.TextBoxes
    Select oTextBox.Text
        Case "PTN_DRAWING"
            oPromptEntry  =  oTitleBlock.GetResultText(oTextBox)
            iProperties.Value("Custom", "PTN_DRAWING")=oPromptEntry
        Case "PTN_REVISION"
            oPromptEntry  =  oTitleBlock.GetResultText(oTextBox)
            iProperties.Value("Custom", "PTN_REVISION")=oPromptEntry
        Case "PTN_TITLE_EN"
            oPromptEntry  =  oTitleBlock.GetResultText(oTextBox)
            iProperties.Value("Custom", "PTN_TITLE_EN")=oPromptEntry
        Case "PTN_DESCRIPTION_EN"
            oPromptEntry  =  oTitleBlock.GetResultText(oTextBox)
            iProperties.Value("Custom", "PTN_DESCRIPTION_EN")=oPromptEntry

    End Select
    Next
Next
Inventor 2025, Vault Professional 2025, Autocad Plant 3D 2025
0 Likes
Accepted solutions (1)
583 Views
4 Replies
Replies (4)
Message 2 of 5

bradeneuropeArthur
Mentor
Mentor

Are the custom properties PTN-_*** in the drawing available already? Otherwise you need to add them first with either code or manually.

With

.doc.propertyset.item(4).add(***,###)

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 5

bradeneuropeArthur
Mentor
Mentor
Dim textValue As String
    textValue = "Here's some text."
customPropSet.Add(textValue, "TextProp")

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 4 of 5

johan.degreef
Advisor
Advisor

Yes they are in the drawing (I added them to my dwg template), but stay empty after running the rule

Inventor 2025, Vault Professional 2025, Autocad Plant 3D 2025
0 Likes
Message 5 of 5

bradeneuropeArthur
Mentor
Mentor
Accepted solution

 

On Error Resume Next
'https://www.cadlinecommunity.co.uk/hc/en-us/articles/203292761
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Dim oPromptEntry

Dim oCurrentSheet
oCurrentSheet = oDoc.ActiveSheet.Name

i = 1
For Each oSheet In oDoc.Sheets
  'i = i+1
  ThisApplication.ActiveDocument.Sheets.Item(i).Activate
       oTitleBlock=oSheet.TitleBlock
    oTextBoxes=oTitleBlock.Definition.Sketch.TextBoxes
    For Each oTextBox In oTitleBlock.Definition.Sketch.TextBoxes
		
    Select oTextBox.Text
		
        Case "<PTN_DRAWING>"
            oPromptEntry  =  oTitleBlock.GetResultText(oTextBox)
            iProperties.Value("Custom", "PTN_DRAWING")=oPromptEntry
        Case "<PTN_REVISION>"
            oPromptEntry  =  oTitleBlock.GetResultText(oTextBox)
            iProperties.Value("Custom", "PTN_REVISION")=oPromptEntry
        Case "<PTN_TITLE_EN>"
            oPromptEntry  =  oTitleBlock.GetResultText(oTextBox)
            iProperties.Value("Custom", "PTN_TITLE_EN")=oPromptEntry
        Case "<PTN_DESCRIPTION_EN>"
            oPromptEntry  =  oTitleBlock.GetResultText(oTextBox)
            iProperties.Value("Custom", "PTN_DESCRIPTION_EN")=oPromptEntry

    End Select
    Next
Next

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature