Add Circular cross section in mechanical via scripting
Hi,
I am trying to add a circular cross section in mechanical via the scripting interface.
I can add one using either commands if there is already the "Cross Sections" folder:
cs = Model.CrossSections.AddCircularCrossSection()
cs = ExtAPI.DataModel.Project.Model.CrossSections.AddCircularCrossSection()
If I try to run it when the CrossSections folder doesn't exist I have the following error message:
'NoneType' object has no attribute 'AddCircularCrossSection'
What am I missing?
Best Answers
-
Looks like the API is missing coverage for this. I will work with our developers to get it fixed. As a workaround, you can use InternalObject, but please note it is undocumented and unsupported:
ExtAPI.DataModel.Project.Model.InternalObject.AddCrossSectionGroup() Tree.Refresh()
@mohamed-koubaa, FYI. Will reach out to discuss.
1 -
This will be exposed in 2025R1.
0
Answers
-
@mohamed-koubaa, I have filed BUG 1050423 as discussed
0 -
Thanks. That really got me puzzled for a while
0 -
Great Thanks!
1