• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Adams
  3. Create Parts from file input

Following Cadence Design Systems’ acquisition of the Design & Engineering (D&E) business, the D&E Community Forum on the Nexus Community Center has been migrated in the Cadence Physical System Simulation Community. For more details and if you have any questions, please refer to the FAQ.

Stats

  • State Not Answered
  • Replies 8
  • Subscribers 3
  • Views 1
  • Members are here 0
More Content

Create Parts from file input

skaka
skaka over 1 year ago

I have text file which contains name of the parts and path to respective part child geometries.

Is it possible to create parts and import geometries under respective parts by text file input.

  • Sign in to reply
  • Cancel

Top Replies

  • Alex Mayes
    Alex Mayes over 1 year ago in reply to skaka +1
    In addition to using Adams.execute_cmd(), there is also Adams. read_geometry_file (file_name="test.stp", type_of_geometry="stp", part_name="PART_2")
  • Alex Mayes
    0 Alex Mayes over 1 year ago

    One option would be to create a python script that parses part_list.txt and then calls the Parts.createRigidBody() and Adams.read_parasolid_file() function.  See the Adams Python Classes Reference, available in the Documentation:

    Adams Basic Package > Adams View > Adams Python Interface > Adams python classes reference

    Here is an example:

    import Adams
    
    file_name = 'part_list.txt'
    
    with open(file_name) as f:
        lines=f.readlines()
    
    part_names = [line.strip() for line in lines[::2]]   #every other line from elem0
    paths = [line.strip() for line in lines[1::2]]       #every other line from elem1
    
    m = Adams.getCurrentModel()
    for part_name, path in zip(part_names, paths):
        m.Parts.createRigidBody(name=part_name)
        Adams.read_parasolid_file(file_name=path, part_name=part_name)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • skaka
    0 skaka over 1 year ago in reply to Alex Mayes

    thanks for reply

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • skaka
    0 skaka over 1 year ago in reply to Alex Mayes

    One question what is command for step file or other cad formats.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Jesper Slattengren
    0 Jesper Slattengren over 1 year ago in reply to skaka

    I don't know if that exists. But you can always use the

    Adams.execute_cmd("file geometry read geometry_type = ..... ")

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Alex Mayes
    0 Alex Mayes over 1 year ago in reply to skaka

    In addition to using Adams.execute_cmd(), there is also Adams.read_geometry_file(file_name="test.stp", type_of_geometry="stp", part_name="PART_2")



    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information