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: 

Add drawings to active project

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
110000474593
3011 Views, 8 Replies

Add drawings to active project

Hello everyone,

 

I encounter a problem that I do not understand. I created a little C# routine for Autocad Electrical (2011 and 2012) which adds some drawings to the current project with the following command:

 

(c:ace_add_dwg_to_project  dwg2add  paramlst)

 

This mehtod works perfectly. With the parameter list you can set the Section, Sub-Section and Descriptions of the page properties, exactly what I want.

 

When I start the routine, I check which project is active. If the wrong project is active, I activate the appropiate project with the following command:

 

(c:wd_makeproj_current  wdpfnam)

 

So, when I want to add drawings to project A and project B is active at the start of the routine, I activate project A and the drawings are added.

 

The problem:

When I want to add drawings to project A and this project is already active, the drawings are not added to the project. The method mentioned above to add drawings returns nill, which means a failure.

 

Why is this happening? Is this a bug of Autocad?

 

I already tried to always activate the project I want to add drawings to, but that doensn't matter.

 

Can anyone help me with this problem?

 

Thanks in advance.

 

 

8 REPLIES 8
Message 2 of 9

This API added the drawing to the active project for me. I was just using lisp to try it. What version of AutoCAD Electrical are you using this on? Also, can you provide what values you are putting in the paramlst?

 

Regards,

Pat Murnen

 



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 3 of 9

This problem occurs in Autocad Electrical 2011, but also in 2012. I didn't try 2013 and 2014 yet.

 

Values I use in the parameter list:

(list "4" "6" (list "" "HOOFDSTROOM" "MCC1") nil)

 

As said before, this works perfectly for me. But it only works when I start with project A and first have to activate project B, because I want to add the drawing to project B. If project B already is the active project, is doesn't work.

 

Are there any other options to add drawings to a project? (beside hacking the .wdp file)

Message 4 of 9

The call worked as expected for me in AutoCAD Electrical 2012.

 

Here is my lisp call that I typed on the command line -

 

(c:ace_add_dwg_to_project "C:\\USERS\\MURNENP\\DOCUMENTS\\ACADE 2012\\AEDATA\\PROJ\\DEMO\\DEMO04.DWG" (list "4" "6" (list "" "HOOFDSTROOM" "MCC1") nil))

 

Can you try typing your call on the command line like this to see if it works? Since yours is wrapped in another call I am just trying to narrow down where it is failing. 

 

By the way, the drawing is always added at the bottom of the list.



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 5 of 9

Typing my call on the command line works fine, but after I run my .dll it doesn't work anymore. So it looks like I do some actions in my .dll file which prevents me from adding files to the active project.

 

I solved this problem with the following command:

(c:ace_wdp_reread)

 

I don't exactly know what this command do, but I think it's kind of a refresh of the project. Using this command each time before adding a drawing to the project solves the problem.

 

I thought is was enough to use this command once, but it wasn't.

 

 

Message 6 of 9

Yes, it is a refresh of a few things project related. Probably the most important one is that it calls the API

wd_mdb2_upd_prj_ixlst which freshens the drawing list and related information like descriptions, etc. in memory.
 
It looks like since you had also posted in the developer forum the case was escalated. If you consider this fixed you may want to post there so they know it is resolved.
 
Regards,
Pat


Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 7 of 9
mjseipn88
in reply to: PatMurnen_Adsk

Autocad Electrical Issue :

I cannot add new drawings in a Active Project, a message appears in the command bar :

 

Failed to demand load: wdcpyprj
Function: (WD_CPYPRJ_CHK4_RELATED_FILES A B)
Failed to demand load: wdupda

 

Someone knows how to fix this issue ?

I´ll appreciate a lot your help ¡

Message 8 of 9
rhesusminus
in reply to: mjseipn88

You should first try to reset AcadE to default settings:
https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2017/ENU/Au...

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 9 of 9
steve
in reply to: 110000474593

I've had exactly the same issue with AcadE 2021

c:ace_wdp_reread no longer exists,

I had to use c:wd_mdb_freshen_noask  instead which solves the problem

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

Post to forums  

Autodesk Design & Make Report

”Boost