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

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

cdnbake
Enthusiast Enthusiast
1,930 Views
9 Replies
Message 1 of 10

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

cdnbake
Enthusiast
Enthusiast

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.
0 Likes
Accepted solutions (1)
1,931 Views
9 Replies
Replies (9)
Message 2 of 10

rhesusminus
Mentor
Mentor
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
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. 😉
0 Likes
Message 3 of 10

cdnbake
Enthusiast
Enthusiast

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.
0 Likes
Message 4 of 10

rhesusminus
Mentor
Mentor
Accepted solution

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
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. 😉
0 Likes
Message 5 of 10

cdnbake
Enthusiast
Enthusiast

Hi rhesusminus, 

nevertheless, thanks for your efforts. 

 

I will close this topic.

 

Have a nice day, 

Bettina

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

Anonymous
Not applicable

bummer.

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

 

0 Likes
Message 7 of 10

rhesusminus
Mentor
Mentor

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

It's really bad.


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. 😉
0 Likes
Message 8 of 10

FRFR1512
Enthusiast
Enthusiast

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
Mentor
Mentor

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
Enthusiast
Enthusiast
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.