Chat with a service agent now! Check out our help button in the bottom right corner!
P1#2 From P1
use the Device method GetViewIds(). example below in pseudo-vbscript. won't run but shows the basics
Set dev = CreateObject("CT.Device")dev.SetId (id of the device you have selected) Dim intViewCount, viewIdsintViewCount = dev.GetViewIds(viewIds) '<<< access device views For j = 1 to intViewCount dev.SetId viewIds(j) Dim msg msg = "Dev: " & dev.GetName() & " #" & dev.GetViewNumber() e3.PutMessage msgNext
thank you so much.
Can i Set attributes to respective View.???
i am not sure that it is possible to set a view with an attribute. try it for yourself.
i've had issues where if i need to read an attribute off of a device and the device happens to be a view, the attribute will not be returned. this is why i don't think its possible to set the view with an attribute.
if it is necessary to store an attribute related to a view, i would store it as an attribute of the view symbol.
FWIW... in order to access the attribute of a device, script needs to check if the device object has a parent using GetOriginald(). If parent exists then need to set the ID to the OriginaId.
Dim intOrginalIdintOriginalId = dev.GetOriginalId()If intOrginalId <> 0 Then dev.SetId intOrginalIdEnd If
Here am trying to assign attribute (UNIT OF MEASURE) in Existing View P1#2.
i tried but am not able to assign attribute to device.
but i can assign attribute to OriginalId() and not to the View(P1#2)
i am not sure i understand your need to set Unit of Measure on a device view. this doesn't sound right.
if a component like a connector has an Unit of Measure set to "EACH", then the unit of measure for all devices of the connector should be "EACH".
if you had multiple views of the same device AND each device had the Unit of Measure BUT different values, then this would introduce conflicts within the data model.
therefore it should not be possible for a representation of a parent device to have attribute values different than its parent.
i recommend accessing Unit of Measure using the Component interface but you'd likely need to update your library so Unit of Measure is defined in the component.
if you have to apply Unit of Measure to a device, you'll need to set it at the parent device, not the view.
Thank you bob.
In case of BoM Position attribute , i want to show BoM Position Value only in Particular View.
If the connector symbol has the following:
Then either the user or a script could set the text type to be visible so that the value of BoM position appears in a particular view.
through the script can i set the text type attribute(BoM Position) for DeviceView??
the TextType belongs to the symbol.
i haven't tried this but presumably you would need to get a list of symbol Ids that belong to the device view. initialize the symbol object to the first ID found, then get a list of TextTypeIds and find the one that matches TextType. then set the text type visibility.
(User Manual Process)
when ever we assign a BOM Postion in Device Properties (parent device ),
is it visible in all device Views???
should be visible if your symbols have the BOM Position text type.
Please sign in to leave a comment.