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

Formatting Report Table with Lisp Script

9 REPLIES 9
Reply
Message 1 of 10
Owen_HillP6JCT
457 Views, 9 Replies

Formatting Report Table with Lisp Script

Hi all,

 

I have written a lisp script to modify the table generated by the cable from/to report. is it possible to modify the autocad script file so that it automatically calls my script after the table is generated?

9 REPLIES 9
Message 2 of 10
vladop
in reply to: Owen_HillP6JCT

I'm not sure exactly what you need, but check out the USER POST if you haven't already.

vladop_0-1724934586932.png

 

Message 3 of 10
rhesusminus
in reply to: vladop

The user post will only work with the data for the report, not the outputted table?

 


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 4 of 10
Owen_HillP6JCT
in reply to: vladop

Sorry if my explanation wasn't clear. I have written a script that modifies the table generated by the report. I am hoping to have it automatically run after the table is generated, rather than having to manually call the script every time a create a report table.

Message 5 of 10

Can you modify your lisp to run the report as well and once the report has placed continue your custom formatting?

Maybe one of the report APIs can help.

 

arshdeepsingh404_2-1724976765514.png

 

 

There is a run script option when you save to file a report but I don't think its available when you choose Put on Drawing option.

 

arshdeepsingh404_3-1724977055786.png

https://forums.autodesk.com/t5/autocad-electrical-forum/script-for-reports/td-p/8905453

 

Another idea could be autorun your formatting every time a drawing is opened. You can do something fancy where you check if a report table exits on a drawing, continue, else exit. Could also do something based on drawing name if the report drawing page names have something in common.

 

See the acaddoc.lsp for Auto-Running AutoLISP Routines.

https://help.autodesk.com/view/ACD/2023/ENU/?guid=GUID-FDB4038D-1620-4A56-8824-D37729D42520

 

Regards,

Arshdeep Singh, C.Tech, CMSE®
Electrical Designer & Programmer
LinkedIn
www.blackcontrols.com

Please mark as "Accept Solution" if this resolved your issue. It might help someone else with the same question. Likes are welcome!
Message 6 of 10

Also can you explain what kind of formatting are looking to achieve with your script.

I am wondering if you can do all that before placing the report using the User Post option like @vladop mentioned.

 

Regards,

Arshdeep Singh, C.Tech, CMSE®
Electrical Designer & Programmer
LinkedIn
www.blackcontrols.com

Please mark as "Accept Solution" if this resolved your issue. It might help someone else with the same question. Likes are welcome!
Message 7 of 10

I think using the userpost options will be able to achieve what I am after. I want to insert a blank line every time the cable number changes. So that each group of cable cores is separated by a blank space. Hope that makes sense.

Message 8 of 10

Yep. That should work with User Post.


Trond Hasse Lie
EPLAN Expert and ex-AutoCAD Electrical user.
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 9 of 10

Yes, give user post a try.

 

If you are only interested in adding visual distinction when the new cable starts, Breaks might be also of interest to you.

 

arshdeepsingh404_0-1725413598369.png

arshdeepsingh404_1-1725413636355.png

 

Regards,

Arshdeep Singh, C.Tech, CMSE®
Electrical Designer & Programmer
LinkedIn
www.blackcontrols.com

Please mark as "Accept Solution" if this resolved your issue. It might help someone else with the same question. Likes are welcome!
Message 10 of 10

I have got my user post code recognising where there is a change in cable number. What is the easiest way to add a blank line to the report?

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

Post to forums  

Autodesk Design & Make Report