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: 

rename Drawing Name

12 REPLIES 12
Reply
Message 1 of 13
kani_mca
1814 Views, 12 Replies

rename Drawing Name

Can we rename Drawing Name using Vb.net in autocad electrical?

 

I used the code Rename(oldpath,Newpath)

 

But its not work,Please Send Code If anybody know..

12 REPLIES 12
Message 2 of 13
vladop
in reply to: kani_mca

File name is part of the project file (text file with .wdp extension).

If file name is changed, it must be changed in the project file too, so that ACADE Project Manager can find that file.

 

Regards,

Vladimir

 

Message 3 of 13
kani_mca
in reply to: vladop

how can we get Wdp File through vb.net code?

Message 4 of 13
vladop
in reply to: kani_mca

ACADE has AutoLISP API.

You use c:wd_proj_wdp_data function to read wdp file, and c:wd_proj_wdp_write to write to wdp file.

There are samples how to use API with Object ARX and Visual Basic.

Hope this helps.

 

Message 5 of 13
kani_mca
in reply to: vladop

i renamed drawing and i also changed WDP file.

i can see in the folder,but in autocad i cant get that..

 

It will be renamed in folderwise and WDP file also,

but it doesnot show in autocad electrical..

Message 6 of 13
kani_mca
in reply to: vladop

I renamed drawing in folder and WDP file..It renamed well...

But i cant see in autocad electrical at that time,Once i restart autocad electrical it will renamed correctly..

 

Autocad electrical is not refresh,if i click refresh icon it will not refresh,,

But if i open another autocad electrical,it renamed correctly. 

Message 7 of 13
johnq
in reply to: kani_mca

Hi

 

Why are you trying to do what you are asking?  It is all so simple using the ribbon.  This might be an excuse as I do not understand the programme you are writing.

 

To change the drawing names the files must be in the project with the project active. Close the drawing within  the project and then rename the drawing.   Use the rename button within the project.  This does all the house work for you.

 

I will follow this thread with interest.

 

Cheers  jq

 

Message 8 of 13
kani_mca
in reply to: johnq

Actually, i want to rename drawing name using vb.net?

So,I renamed Drawing name in WDP file...

when i renamed drawing name in wdp file using vb.net code, it will changed drawing name correctly in Wdp file and folder also..

But i cant see that changes in AutoCAD Electrical Window. Once i restart AutoCAD Electrical, i can see that changes.

 

Message 9 of 13
vladop
in reply to: kani_mca

ACADE is not aware of changes done only using vb.net.

Using API functions or RENAME command, project update is invoked.

Project update is also invoked on ACADE restart and that is why changes are seen.

Message 10 of 13
kani_mca
in reply to: vladop

ok thanks for your update...

Can we close and open a Project in "Project Manager" using vba?

Message 11 of 13
vladop
in reply to: kani_mca

API function for opening project is c:wd_makeproj_current.

By opening some other project, active project is closed.

Again, this is LISP function.

I'm not sure, but in Visual Basic something like

ThisDrawing.SendCommand ("(c:wd_makeproj_current wdpfnam)") should be used,

where wdpfnam is full path of project ".wdp" file name (this project does not have to be displayed in the list i.e. does not have to be "open").

 

 
Message 12 of 13
johnq
in reply to: vladop

Hi Kani

 

I said I would follow this thread as I am interested.  I looked up what the code for what you are doing amd I ask:  WHY?

 

ACE is data base driven.   It will let you edit drawings using ACAD commands BUT it will "break" the data base.

 

This is from accidental experience and more learned contributers to this forum.

 

I have written FORTRAN, assembler for various chips and computers, HTML.

 

I am sure you will achieve what you are aiming toi achieve but will ACE work?   IMHO a big NO.  I am willing to listen and learn.

 

If you need non ACE users to see drawings then get a suitable free viewer.

 

Cheers with interest   John Q

 

 

 

 

Message 13 of 13
kani_mca
in reply to: vladop

It works well..

 

I want to close a project,instead of closing manually.

To close a project, right-click the project name and select Close.

 

I want to close project using command line function..can?

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

Post to forums  

Autodesk Design & Make Report

”Boost