How to get element's calculation attributes ? #208
Unanswered
Lefort-Antoine
asked this question in
Q&A
Replies: 2 comments 1 reply
-
|
Hi, If you know the range, you can iterate over the elements and store the attributes in a list. element_attributes_map = defaultdict(list)
your_attribute_range = range(1, 80) # check for attributes from userattribute 1 to userattribute 80
for element_id in element_ids:
for value in your_attribute_range:
attribute_value = ac.get_user_attribute(element_id, value)
if attribute_value:
element_attributes_map[element_id].append(attribute_value)
for key, value in element_attributes_map.items():
print(f"Element {key} : attributes {value}")same, but more compact element_attributes_map = {
element_id: [ac.get_user_attribute(element_id, value) for value in your_attribute_range if ac.get_user_attribute(element_id, value)]
for element_id in element_ids
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
To get all used "user attributes" you can use the function To get the total production list count, you have to setup a datastructure by yourself. # cadwork imports
from collections import defaultdict
element_same_production_nr = defaultdict(list)
for element in active_identifiable_element_ids:
production_nr = ac.get_production_number(element)
element_same_production_nr[production_nr].append(element)
for production_nr, elements in element_same_production_nr.items():
print(f"Production Number: {production_nr}")
for element in elements:
print(f"Element ID: {element}") |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
I'm a beginner.
I found no way to get all the attribute of an element. Not only the auto or specific as beam list I need all of them !
Thanks for your help
Beta Was this translation helpful? Give feedback.
All reactions