Plant3d is crashing when running code

Plant3d is crashing when running code

dennis
Advisor Advisor
468 Views
1 Reply
Message 1 of 2

Plant3d is crashing when running code

dennis
Advisor
Advisor

The program '[12500] acad.exe' has exited with code -1073740940 (0xc0000374).  The msg shows up in the Visual Studio Output when Plant crashes.

I have some code running, basically as a "Drip Fixer", tries to complete connections between piping parts.

It appears to run fine.  However, when I change projects to run the code in another drawing, while not every time, often enough to think it is related to my code somehow, Plant will crash with no error message.  Just "blink" and gone.

In the workflow, I can run the code, save the drawing, close the drawing.  But before I can select another project to load, the little blue circle starts spinning, then crash.

I have commented out code to try to narrow it down, I think it has to do with adding a port to a primary pipe to host a tap/stubin and then using RoutingHelper to make the connection.

 

If it would crash when I am running the code, that would make more sense to me.  But it doesn't, not until I close the drawing to open another project.

 

Any insights would be appreciated.

0 Likes
Accepted solutions (1)
469 Views
1 Reply
Reply (1)
Message 2 of 2

dennis
Advisor
Advisor
Accepted solution

Working through this was laborious, with continuous frustration.  However, I seem to have discovered two very important steps that need to be followed:

 

1.  I made several working Plant Projects, zipped them up, and would pull out fresh ones as needed.  I discovered, once a fresh set were extracted, I needed to use the OPEN option to access the refreshed Projects, rather than relying on the stored names in the Project Manager list.  For some reason, even though the stored pointers were pointing to the exact same location, and Plant would indeed open them, something was amiss and errors would erupt in the code.  The process needed to be very specific follow a refresh of the projects from the zip.

  • Use the OPEN option to access the project by picking the project.xml
  • Load a drawing, do stuff, close the drawing.
  • Then use the OPEN again to access the next project.

I couldn't even use the OPEN option if the current project still had a drawing open.  I had to close the drawing, get to the StartUp screen, then use the OPEN.  Once all the projects had been opened this way, then and only then, could I jump projects using the stored list in the Project Manager.

 

2. If you are making Pairs for port connecting, do not store new Pairs in memory.  I had a loop running that would check for branches and would define a Pair with a Port defined where I wanted it.  I would build a list of these new Pairs with their associated Pair on a Pipe end to be added and then connected later in the code.  Once I stopped doing that and defined the needed Port and Pair when I was ready to actually make the connection, the code ran fine.

 

Putting this all here for future reference should someone else run into the same thing that I have.

 

0 Likes