Can you help this label rotate function. this code is working, other than orient, I wanted to add justify function as well because when the labels got rotated (R180), the label will be "flipped" and I want to correct it.
here's the code:
foreach(fig geGetSelSet() when(fig~>orient fig~>orient =case(fig~>orient ("R0" "R90" ) ("R90" "R180" ) ("R180" "R270" ) ("R270" "R0" ) (t fig~>orient ) ) ) )
Sorry I'm new to skill code programming. I saw this posted by Andrew B., this is what I would like but just use 1 bindkey to cycle to the options.
The following snippet should work out of the box. (Even though It might be over-complicated if you are new to SKILL)
;; SKILL++ is required so the defined function can always access the following variable
'(("centerRight" "R90" )
("centerRight" "R0" )
("centerLeft" "R0" )
;; Build infinite loop from list by making it point to itself
(nconc infinite_loop infinite_loop)
(defun get_selected_labels ()
"Return currently selected labels"
(setof obj (geGetSelectedSet) (equal "label" obj->objType)))
(defglobalfun custom_cycle_label_orients ( @key (labels (get_selected_labels))
"Cycle through a list of predefined orient/justification pairs and set them to LABELS"
(destructuringBind (justify orient) (pop infinite_loop)
(foreach label labels
(setf label->justify justify)
(setf label->orient orient )
(hiSetBindKey "Layout" "<Key>F5" "custom_cycle_label_orients")
If you are eager for any explanation, I'll be happy to detail how it works
Hope this helps,
Thanks Aurélien! I tested it and it works!