steputils
steputils copied to clipboard
read existing STEP files
Hello, i want to make a program, that extracts the name of parts out of a STEP file. For this i m using the p21.py and the Functions p21.readfile(). ` stepfile = p21.readfile(FNAME) #works fine
stepfile = p21.readfile("C:\Users\maxim\Desktop\...\plate203.STEP") # doesnt work
` I dont have a clue why it doesnt work. I tried to modify the path with an r in front of it, etc. Nothing works... Thanks for your help :) Greetings Egon
from steputils import p21
FNAME = "./1.STEP"
try:
stepFile = p21.load(open(FNAME)) print(dir(stepFile)) except IOError as e: print(e)
else: print(f'File {FNAME} is a valid STEP-file')