steputils icon indicating copy to clipboard operation
steputils copied to clipboard

read existing STEP files

Open EgonScofield opened this issue 4 years ago • 1 comments

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

EgonScofield avatar Dec 04 '20 09:12 EgonScofield

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')

IDONTSUDO avatar Feb 06 '23 10:02 IDONTSUDO