How to undo user attribute modification? #279
Answered
by
Brunner246
Antoine-S-C
asked this question in
Q&A
-
|
After code execution, how can I undo an user attribute modification (with the undo button)? |
Beta Was this translation helpful? Give feedback.
Answered by
Brunner246
Sep 23, 2025
Replies: 1 comment
-
|
you have to set the undo before modifying elements. import cadwork
import element_controller as ec
import geometry_controller as gc
import attribute_controller as ac
elements = ec.get_active_identifiable_element_ids()
modify: int = 2
user_attribute_nr: int = 7
ec.add_elements_to_undo(elements, modify)
ac.set_user_attribute(elements, user_attribute_nr, "Hello World") |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Antoine-S-C
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you have to set the undo before modifying elements.