API created geometry is invisible and unelectable until the document closes and opens again

API created geometry is invisible and unelectable until the document closes and opens again

Joshua.mursic
Advocate Advocate
439 Views
3 Replies
Message 1 of 4

API created geometry is invisible and unelectable until the document closes and opens again

Joshua.mursic
Advocate
Advocate

Hello, I am having a strange issue after the latest update, where, sometimes, the Brep Bodies that I create are invisible and unelectable, even though they show up inside the browser tree. When I close and reopen the document, they appear and function as normal, but I am not sure what is causing this issue, and forcing the document to close and open using the API takes much to long to be a good workaround. Any ideas on how to avoid this issue?

0 Likes
Accepted solutions (1)
440 Views
3 Replies
Replies (3)
Message 2 of 4

kandennti
Mentor
Mentor

Hi @Joshua.mursic -San.

 

I have no experience with this phenomenon.

I don't know if it works, but here is the process I can come up with.

        app: core.Application = core.Application.get()
        des: fusion.Design = app.activeProduct

        des.computeAll()
        app.activeViewport.refresh()

 

0 Likes
Message 3 of 4

Joshua.mursic
Advocate
Advocate

Thank you @kandennti, I was not aware of the  computeAll() method. I will add this and see if the error appears again. It is very random and I cannot reliably reproduce the error. 

0 Likes
Message 4 of 4

Joshua.mursic
Advocate
Advocate
Accepted solution

Unfortunately this did not solve the issue. I have attached a short video that shows the issue. The browser tree is not in the video for some reason but you can see that the created bodies are not visible or selectable before the document is closed but they are after it has been reopened. 

 

However, I found that if I move the created body into the root component or create a new component using the body then it will become visible and selectable. So I am doing this as a workaround.

body = body.moveToComponent(occurrence.component.parentDesign.rootComponent)
body = body.moveToComponent(occurrence)

 

Thanks for the help