AnsweredAssumed Answered

Cannot set custom property in drawing file

Question asked by Nick Sinno on Sep 19, 2018
Latest reply on Sep 19, 2018 by Nick Sinno

Been working on a custom renaming/copying/moving macro, and want to add the date modified. We store our dates in the actual drawing files custom properties, and I take just a text input for the date (user entered). Im running into an issue where I cannot add a custom property to my drawing file, no matter the name. I also cannot use the "Set2" property to change the value of an existing property. I can read any of the values just fine, and the textbox input is coming through fine. Ive no idea whats going on here.


See below my current test code;


Private Sub renameDWG(replaceRef As Boolean)

    Dim sDWG As DrawingDoc

    Set dwgDoc = sApp.OpenDoc6(compDWG, 3, 1, "", lErrors, lWarnings)

    dwgDoc.SaveAs4 pathNameBox.Text & partNameBox.Text & ".SLDDRW", 0, 1, lErrors, lWarnings

        Set custProp = dwgDoc.Extension.CustomPropertyManager("")

        custProp.Add3 "DrawnDate", 30, dateBox.Text, 1

        derp2 = custProp.Get("Revision")

        custProp.Set2 "Revision", "Revised"

        derp3 = dateBox.Text

'    doProperties (1)

    sApp.QuitDoc pathNameBox.Text & partNameBox.Text & ".SLDDRW"


    boolStatus = sApp.ReplaceReferencedDocument(pathNameBox.Text & partNameBox.Text & ".SLDDRW", compMod.GetPathName, pathNameBox.Text & partNameBox.Text & compExt)

End Sub