When 1 item is selected you can use the global variable !!ce to access that item
Is there a variable for when multiple items are selected - Current selection ?
Thanks
When 1 item is selected you can use the global variable !!ce to access that item
Is there a variable for when multiple items are selected - Current selection ?
Thanks
You can use the .getCurrent() method on a Selection object.
For example:
!exampleMyVariable = object selection()
!exampleMyVariable.getCurrent()
Q var !exampleMyVariable
Online AVEVA Help Reference
https://help.aveva.com/AVEVA_Everything3D/3.1/wwhelp/wwhimpl/js/html/wwhelp.htm#href=SCRM/SCRM3.3.42.html#1361369
In addition, I think that the Current Element and selected element are technically two distinct things in AVEVA.
I think you can select one item in 3D View but you can have another item as Current Element in the Model Explorer
I have nothing selected in the graphical display, but would like to change the colour of the current item I'm sitting on in the explorer which is already in the drawlist or not.
Why does this not work :
add ce $* this makes sure it's in the drawilst
!x = !!gphdrawlists.drawlist(!!fmsys.currentdocument().view) $* gets drawlist
!x.colour(!!ce, 1) $* this changes the colour
The colour does not change
Hello, your question seems to be a different one from your question 4 months ago. For the purpose of this forum's searchability, please create another post for a new question.
Anyway, going back to the question.
If your CE is a piping component and you use the command "add ce", then actually the owning piping branch is added to the drawlist.
In order for the command "!x.colour(!!ce, 1)" to work, the !!ce element reference must be equal to an element reference in the drawlist.
It's part of the same question but i managed to get it done by using a collection.
There is a subtle difference between a PML1 collection and PML2 collection
PML1 collection is an array of references as strings whereas the PML2 retruns an array of DBREF's
So I just added this line into my program instead of : add ce i use !z = !!CollectAllFor('','',CE) then !x.colour(!z, $1)