Add Circular cross section in mechanical via scripting

cedev Member Posts: 3
First Comment


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 Answer

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee Posts: 208
    First Answer First Comment 5 Likes First Anniversary
    edited May 20 Answer ✓

    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:


    @mohamed-koubaa, FYI. Will reach out to discuss.