Hello, how can I change the Variant.Description with a script. I can change the Variant with the Design.SelectVariant() command and I can then get the variant description with Design.GetAttribute("<Current Variant Description>")
Then I want to change the the description through the DesignItem-Obtject variant.description In the help I see that I can set this data, but how can I do that?
There isn't a way to get the current variant, nor to directly change its name or description.
However, you can iterate through the variants in the design and set their descriptions like this:
'vbs Option Explicit Dim psxDoc, psxVariants, psxVar Set psxDoc = Application.ActiveDocument() 'an active schematic design containing a few variants… Set psxVariants = psxDoc.Variants For each psxVar in psxVariants psxVar.Description = "My new description" Next
Maybe you could include a test to see if psxDoc.CurrentVariantName = psxVar.Name to ensure that you change the name of only the current variant.