Jump to content

can a macro open a drawing


jamesfear

Recommended Posts

I had a look around and couldn't find a solution to this, there has been unanswered posts about it aswell so I'm just calling out for help again.

 

Here is what I have so far;

 

^c^cfiledia;0;open;c:\example\symsht-2.dwg;filedia;1;

 

and this is what I get

 

Command:

Command:

Command: filedia

Enter new value for FILEDIA : 0

Command: open

Command: c:*Cancel*

 

Reason I'm wanting to do this is, I'm not sure if there is a way to hyperlink something into my palettes so that I can open up a drawing from the palette. I also want to be able to use on LT versions. So lisps are out of question....:cry:

Link to comment
Share on other sites

Try:

 

^c^cfiledia;0;open;"c:/example/symsht-2.dwg";filedia;1;

 

From the help:

NoteWhen specifying a directory path, you must use a slash (/) or two backslashes (\\) as the separator, because a single backslash has a special meaning in AutoLISP.

Link to comment
Share on other sites

Thank you Pablo for your fast reply but it's still going

 

Command:

Command:

Command: filedia

Enter new value for FILEDIA : 0

Command: open

Command: "c:\example\symsht-2.dwg"

Unknown command

""c:\example\symsht-2.dwg"". Press F1

for help.

Command: filedia

Enter new value for FILEDIA : 1

Link to comment
Share on other sites

:?:?Hi friends,

I am also need this solution. how can open a drawing using macro? please solve if possible.......................thank you:?:?:?

Link to comment
Share on other sites

Are you still using 'Back slashes' instead of 'Forward slashes'?

 

nar I used forward slashes I just paste the wrong quote lol mm

Link to comment
Share on other sites

This is what I get when I use this

 

^c^cfiledia;0;open;"c:/example/symsht-2.dwg";filedia;1;

 

 

Command:

Command:

Command: filedia

Enter new value for FILEDIA : 0

Command: open

Command: "c:/example/symsht-2.dwg"

Unknown command ""C:/EXAMPLE/SYMSHT-2.DWG"". Press F1 for help.

Command: filedia

Enter new value for FILEDIA : 1

Command: FILEDIA

Link to comment
Share on other sites

  • 1 month later...

try

^c^cfiledia 0 open "c:/example/symsht-2.dwg" filedia 1

if it doesn't work change / to \

You will have problems with "c:\example\symst 2.dwg" the space in the file name causes problem. There is an answer but not with LT

Link to comment
Share on other sites

I have just put-

 

^C^Cfiledia;0;open;"G:/Server1staff/Drawings/JFNL/project/drawings/WELDED ASSY.dwg";filedia;1;

 

onto a button in LT2002 and it works fine, even with the space in the drawing name.

 

The Autocad text window shows-

 

Command: filedia

 

Enter new value for FILEDIA : 0

 

Command: open

 

Enter name of drawing to open

:

"G:/Server1staff/Drawings/JFNL/project/drawings/WELDED ASSY.dwg"

 

Opening an AutoCAD LT 2000/AutoCAD 2000 format file.

Regenerating layout.

Regenerating model.

 

Command: Press ENTER to continue:

 

Command:

Link to comment
Share on other sites

I just found out that if you create a script that opens the drawing you want and use a macro to open up that script it woulds like a charm!

 

Create a new text document (txt) and use the following

open
"C:\ExampleFolder01\ExampleDrawing01.dwg"
y
y

 

save that text document as a

.scr

file and save it somewhere you can find easy e.g. c:\New Text Document.scr

 

 

than create a marco with the following;

^C^CSCRIPT "c:\New Text Document.scr"

 

 

There you go =]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...