Jump to content
jamesfear

can a macro open a drawing

Recommended Posts

jamesfear

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:

Share this post


Link to post
Share on other sites
Pablo Ferral

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.

Share this post


Link to post
Share on other sites
jamesfear

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

Share this post


Link to post
Share on other sites
ReMark

Hyperlinks aren't a feature in AutoCAD LT?

Share this post


Link to post
Share on other sites
manirpg

:?:?Hi friends,

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

Share this post


Link to post
Share on other sites
Pablo Ferral

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

Share this post


Link to post
Share on other sites
jamesfear
Are you still using 'Back slashes' instead of 'Forward slashes'?

 

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

Share this post


Link to post
Share on other sites
jamesfear

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

Share this post


Link to post
Share on other sites
BIGAL

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

Share this post


Link to post
Share on other sites
nukecad

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:

Share this post


Link to post
Share on other sites
Pablo Ferral

Thanks for the example...

Share this post


Link to post
Share on other sites
jamesfear

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 =]

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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