AutoCAD Plant 3D Forum
Welcome to Autodesk’s AutoCAD Plant 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Plant 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is there any workaround to insert in python script to know in which line my script gone wrong ?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
bagusvirdo
357 Views, 4 Replies

Is there any workaround to insert in python script to know in which line my script gone wrong ?

Hi All, as the title said, is there any workaround to insert in python script to know in which line my script gone wrong?

may it shown in AP3D command lines when testing with (testacpscript "XXX")?

it keeps giving me "Geometry can not be generated with the given parameters.nil" error

 

thanks in advance

4 REPLIES 4
Message 2 of 5
h_eger
in reply to: bagusvirdo

@bagusvirdo ,

 

I don't know of any function that could provide this in Python for AutoCAD Plant 3D.
In your case, the default parameters do not match the construction functions.

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature



Message 3 of 5
jabowabo
in reply to: bagusvirdo

You can strategically place 'print' commands throughout your code. These will display in the AutoCAD command line. From there, you can determine the last successful 'print' line of code.

 

print ("if this line shows in the command line, then code is successful to this point")
Message 4 of 5
matt.worland
in reply to: bagusvirdo

The Python module is broken in the current version of 2025.

 

In previous versions of Plant 3D, you could print statements in your code. And if the PlantRegisterCustomScritps command found errors, it would tell you the file and line the registration errored out on.

 

In the current release of 2025 you will need to use writeLine statements. Create a new text file and write out instead of printing to the console.

 

Autodesk Development Team is aware of this and said it should be fixed in 2025.1

If my reply was helpful, please give a "Thumbs Up" or "Accept as Solution"
Message 5 of 5
bagusvirdo
in reply to: jabowabo

Thanks for the reply Eger, Jason, Matt,, 

 

"You can strategically place 'print' commands throughout your code. These will display in the AutoCAD command line. From there, you can determine the last successful 'print' line of code."

 

exactly what I'm looking for,

 

this is what I insert in my script to track any mistakesthis is what I insert in my script to track any mistakesand this is what appear on my AP3D command windowand this is what appear on my AP3D command window

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report