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: 

How to remove deleted projects from the Project Manager via Lisp?

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
cdnbake
1240 Views, 9 Replies

How to remove deleted projects from the Project Manager via Lisp?

Hello community,
is there any way I can programmatically remove a project node from the Project Manager if the file does not exist anymore?

Whenever I delete a project file from my hard drive, I need the Project Manager to update itself and remove the corresponding project nodes, without having to restart AutoCAD Electrical. Currently, it only changes the project status to "Not found".

Is there a Lisp routine or even an ObjectARX API that can do something like this? If the deleted project was the last project in the list, the Project Manager needs to be empty, just like when I restart the CAD afterwards.

Unfortunately, neither the command "ace_closeproject" nor the right click menu option "Close" work for the (last) active project.


It would be great if someone could help me with that.

Kind regards,
Bettina

Bettina Kutsche
CIDEON
take the value perspective.
9 REPLIES 9
Message 2 of 10
rhesusminus
in reply to: cdnbake

From the API help file:
(wd_pds_close_project "C:/Projects/Demo/wddemo.wdp")

I'm not sure if it will close it if it's the last project in the list. You cannot do that manually in AcadE.

Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 3 of 10
cdnbake
in reply to: rhesusminus

Hi rhesusminus, 

thank you for your quick reply.

 

I just tried out your suggestion in the AutoLisp console, but all the function did was returning 'T'. The project remained in the Project Manager, regardless of whether it was active or the last project or not.

 

I tried the file path with forward slashes, single backward slashes and double backward slashes, but the result was always the same.

 

 

(wd_pds_close_project "C:/Users/bettina.sprenger/Documents/Acade 2017/AeData/Proj/NfpaDemo/Nfpademo.wdp")
(wd_pds_close_project "C:\Users\bettina.sprenger\Documents\Acade 2017\AeData\Proj\NfpaDemo\Nfpademo.wdp")
(wd_pds_close_project "C:\\Users\\bettina.sprenger\\Documents\\Acade 2017\\AeData\\Proj\\NfpaDemo\\Nfpademo.wdp")

Am I missing something?

 

Kind regards, 

Bettina

Bettina Kutsche
CIDEON
take the value perspective.
Message 4 of 10
rhesusminus
in reply to: cdnbake

Sorry, my bad. That command is only for the PDS, opening and closing a project "in memory", and not in the project manager.

 

Then, I'm all out of ideas. Can't find any documented ways to achieve this.


Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 5 of 10
cdnbake
in reply to: rhesusminus

Hi rhesusminus, 

nevertheless, thanks for your efforts. 

 

I will close this topic.

 

Have a nice day, 

Bettina

Bettina Kutsche
CIDEON
take the value perspective.
Message 6 of 10

bummer.

The more I try to use these APIs the more road blocks I encounter.

 

Message 7 of 10

There's a reason I call it an "API".

It's really bad.


Trond Hasse Lie
AutoCAD Electrical and EPLAN expert
Ctrl Alt El
Please select "Accept Solution" if this post answers your question. 'Likes' won't hurt either. 😉
Message 8 of 10
FRFR1512
in reply to: cdnbake

Hi

I think you can do this externly of AutoCAD electrical

Have a look to the Text file LASTPROJ.FIL, you can delete the line you need and restart electrical

Message 9 of 10
Icemanau
in reply to: FRFR1512

It's a matter of workflow that is easily solved...

 

You just need to train yourself to CLOSE the project in the Project Manager BEFORE you move or delete the project.

This will solve ALL the problems without having to re-start ACADE

 

Where you only have the one project open, I would suggest a placeholder project just to have a project in the list if you need to close the Active project. You can then use the placeholder project for those small single dwg jobs or testing if something will work before it's applied to a working project.

 

Regards Brad

>

Brad Coleman, Electrical Draftsman
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 10 of 10
cdnbake
in reply to: FRFR1512

Hi there,
manipulating the LASTPROJ.FIL before an ACADE restart is a good hint that I will forward to my colleagues, thank you very much.

However, in my special case, I was looking for a way without having to restart ACADE. Editing the LASTPROJ.FIL while the application is still running does unfortunately not cause an immediate update of the project manager view.

Kind regards,
Bettina
Bettina Kutsche
CIDEON
take the value perspective.

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

Post to forums  

Autodesk Design & Make Report

”Boost