AnsweredAssumed Answered

"AddAttribute" usage in DxDesigner

Question asked by Dennis_K on May 11, 2012
Latest reply on May 14, 2012 by Dennis_K

Hello at all,


I'm quite unexperienced with vbs scripting. But with the help of all those examples out there (thanks to all who offer such stuff freely) I was able to write scripts which fit my needs well.

But now I have an issue with non-common properties from older DxD versions in my projects. Therefore I have to readd the property "Assembled" with its value by using the "addAttribute" Method:


For Each objCompAttr in objComp.Attributes

     If = "Assembled" THEN


          sCompAttrNameValue = objCompAttr.Name & "=" & objCompAttr.Value

          sCompAttrVisible = objCompAttr.Visible

          Set sCompAttrLoc = objCompAttr.GetLocation()


          Set oComp = objComp.AddAttribute(sCompAttrNameValue, sCompAttrLoc.X, sCompAttrLoc.Y, sCompAttrVisible)


First I looked in the automation help and tried it this way: objComp.AddAttribute(sCompAttrNameValue, sCompAttrLoc.X, sCompAttrLoc.Y, sCompAttrVisible) but I always get an error message After some research I found the line above with the "Set oComp = ..." line. I don't understand why I had to do this. Why not just call the method? What is the sense of the "Set oComp=..." expression in this case? Does the name oComp matter or can I also use "Set XYZ=..."?

It drives me mad when I do something but don't know why so please can you point me in the right direction...


Thanks, kind regards,