How to change the width of a path using skill code.
I tried to chage the width of a selected Metal path using skill, but it is showing an *Error* message..
path~>width=list(0.1)*Error* dbSetq: Invalid path width - (0.1)
I've solved this by assigning directly.
In reply to SS007:
The reason why this is the case is because geGetSelSet() is returning a list of path objects. If you do list_of_dbIds~>width it will return a list of the width attribute values for each member of the list of dbIds - it corresponds to doing foreach(mapcar dbId list_of_dbIds dbId~>width).
When you assign using ~>, a similar thing happens, it will iterate over the dbIds and set the width attribute on each, so:
list_of_dbIds~>width=0.1 is effectively like doing foreach(dbId list_of_dbIds dbId~>width=0.1) (actually it's a mapcar again, because it will return the result of the assignment, but that's a detail I won't bore you with. If instead you had a list of widths:
and had two things selected, and you wanted to set them in turn, you could do:
foreach((dbId width) list_of_dbIds widthList dbId~>width=width)
Hope that makes it clearer.
In reply to Andrew Beckett:
Thank you Andrew
You gave me a clear picutre about it