Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Supress Subassembly in Assembly #87

Open
jordifas opened this issue Apr 2, 2024 · 0 comments
Open

Feature Supress Subassembly in Assembly #87

jordifas opened this issue Apr 2, 2024 · 0 comments

Comments

@jordifas
Copy link

jordifas commented Apr 2, 2024

  • Creo version: 6.0.6
  • Creopyson version: 0.7.7
  • Creoson version: 2.8.2
  • Python version: 3.11
  • Operating System: W10

Description

I try to supress a subassembly in an assembly.

What I Did

import creopyson

c = creopyson.Client()
c.connect()

c.file_open(file_="VW003041.asm", new_window=True, display=True)
c.feature_suppress(name="094666.prt")
c.file_close_window(file_="VW003041.asm")
c.file_regenetrate(file_="VW003041.asm")
c.file_open(file_="VW003041.asm", new_window=False, display=True)

llista_id = [component["name"] for component in c.feature_list()]

for comp in llista_id:   
    creopyson.feature_suppress(c,name=comp, with_children=False, clip=False)

I tried these two approaches. The error I got is the following:

Traceback (most recent call last):
  File "w:\Pro_Utils\Macro\AppsElebia\prova_supriir.py", line 7, in <module>
    c.feature_suppress(name="058405.prt")
  File "W:\Pro_Utils\Macro\AppsElebia\.venv\Lib\site-packages\creopyson\feature.py", 
line 665, in suppress
    return client._creoson_post("feature", "suppress", data)        
  File "W:\Pro_Utils\Macro\AppsElebia\.venv\Lib\site-packages\creopyson\connection.py", line 75, in _creoson_post
    raise RuntimeError(error_msg)
RuntimeError: A Pro/TOOLKIT error has occurred: Bad Context.  Check your model/drawing for accuracy.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant