8 Replies Latest reply on May 9, 2017 7:08 PM by Jon Christensen

    Add2 vs Add3 for adding custom property?

    Jon Christensen

      Well I still VERY green at VB and macros. After several hours of looking at different examples I am not sure what should be done.

      I have a Global variable called "Gauge_Number" and want to create a customer property called Gauge. And Gauge = Gauge_Number. I have tried it two different ways and one way (Add2) works and the other Add3 does not. Is there any good reason to use one versus the other? If Add3 is better to use then what is wrong with my syntax?

       

      This works.

      FileName = Mid(swModel.GetPathName, InStrRev(swModel.GetPathName, "\") + 1)

      lRet = swModel.Extension.CustomPropertyManager("").Add2("Gauge", swCustomInfoType_e.swCustomInfoText, Chr(34) & "Gauge_Number@" & FileName & Chr(34))

       

      This does not work.

      FileName = Mid(swModel.GetPathName, InStrRev(swModel.GetPathName, "\") + 1)

      swCustProp.Add3 "Gauge", swCustomInfoText, Chr(34) & "Gauge_Number@" & FileName & Chr(34), 1

       

      Thanks!