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
Anonymous
3354 Views, 8 Replies

Add drawings to active project

Anonymous
Not applicable

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.

 

 

0 Likes

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
PatMurnen_Adsk
in reply to: Anonymous

PatMurnen_Adsk
Alumni
Alumni

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.

0 Likes

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
Anonymous
in reply to: PatMurnen_Adsk

Anonymous
Not applicable

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)

0 Likes

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
PatMurnen_Adsk
in reply to: Anonymous

PatMurnen_Adsk
Alumni
Alumni

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.

0 Likes

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
Anonymous
in reply to: PatMurnen_Adsk

Anonymous
Not applicable
Accepted solution

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.

 

 

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
PatMurnen_Adsk
in reply to: Anonymous

PatMurnen_Adsk
Alumni
Alumni

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.

0 Likes

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
Anonymous
in reply to: PatMurnen_Adsk

Anonymous
Not applicable

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 ¡

0 Likes

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: Anonymous

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

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
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 9
Anonymous
in reply to: Anonymous

Anonymous
Not applicable

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

0 Likes

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