Message 1 of 3
Trying to create custom iProperties using prompted properties

Not applicable
03-04-2020
06:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been looking online and in the forum, found a few things but couldn't make things work. I have a "prompted property field" window that pops up, and all I want to do is convert those properties into iProperties so I can autofill text boxes and property fields in other sheets.
Found this online (and a few others, but this was the simplest), but I can't quite get it to work.
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 "DRAWING NUMBER"
oPromptEntry = oTitleBlock.GetResultText(oTextBox)
iProperties.Value("Project", "Part Number")=oPromptEntry
End Select
Next
Next
ThisApplication.ActiveDocument.Sheets.Item(oCurrentSheet).Activate
ddoc = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)
'iProperties.Value(ddoc, "Project", "Part Number") = iProperties.Value("Project", "Part Number")
iProperties.Value(ddoc, "Custom", "Drawing No") = iProperties.Value("Project", "Enter Product M2M NUMBER")
iLogicVb.UpdateWhenDone = True
I have coded in other languages but for some reason (maybe I'm just too tired at work) this ones throwing me for a loop.
If someone could either help explain what I should change or suggest different code, that would be amazing.