Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Opening a drawing thru a toolbar button...

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
138 Views, 4 Replies

Opening a drawing thru a toolbar button...

Hi all,

I have been checking google newsgroups trying to find a lisp or script that
I can use with a user-made toolbar button to open a certain drawing file in
AutoCad....

In all the posts I have read over the past 3 days, I have yet to see a
complete and constant answer to the "opening a drawing" question.

The drawing I want to open is say "XOX.dwg" on

U:\Standard Drawings\Standard AA\Folder B1\

What would I write either as a lisp or as a script/macro to open this
drawing....even if it is READ only, etc.?

I am totally non-plussed with this one...

Any help with this would be appreciated

(BTW: SDI = 0 on normal settings)

Regards,

DP
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

(command "open" "U:\Standard Drawings\Standard AA\Folder B1\XOX.dwg")


--

Chip Harper
Member of the AutoDesk Discussion Forum Moderator Program
Message 3 of 5
Anonymous
in reply to: Anonymous

Hi David,

An AutoCAD toolbar icon simply runs a script. Hence, all you need do is
carefully duplicate the keystrokes you would type from the Keyboard to
achieve the result you require. Simply replace the use of the key
with semi-colons ";" but without the inverted commas.

However, in this case there is a further difficulty in that the drawing may
be read-only which requires a different number of keystrokes. Hence you
will need a program to detect if the file is read only and proceed
accordingly.

Here's a little extract from the help files on VBA
Sub Example_ReadOnly()
' This example shows if current drawing file is read only or not

If ThisDrawing.ReadOnly Then
MsgBox "The current drawing file is read only.", , "ReadOnly
Example"
Else
MsgBox "The current drawing file is read-write.", , "ReadOnly
Example"
End If

End Sub-- Laurie ComerfordCADAppswww.cadapps.com.au"David Penney"
wrote in message
news:056FDA3D7622D421DD77C2D5A1C77D97@in.WebX.maYIadrTaRb...
> Hi all,
>
> I have been checking google newsgroups trying to find a lisp or script
that
> I can use with a user-made toolbar button to open a certain drawing file
in
> AutoCad....
>
> In all the posts I have read over the past 3 days, I have yet to see a
> complete and constant answer to the "opening a drawing" question.
>
> The drawing I want to open is say "XOX.dwg" on
>
> U:\Standard Drawings\Standard AA\Folder B1\
>
> What would I write either as a lisp or as a script/macro to open this
> drawing....even if it is READ only, etc.?
>
> I am totally non-plussed with this one...
>
> Any help with this would be appreciated
>
> (BTW: SDI = 0 on normal settings)
>
> Regards,
>
> DP
>
>
Message 4 of 5
Anonymous
in reply to: Anonymous

Thankyou Chip..

I could swear that was one of the command routines I tried and it
failed....but I may be wrong...as I tried all sorts of things

Regards,

DP

"Chip Harper" wrote in message
news:8A763A3D95D56719CC1C2E71FB9142B1@in.WebX.maYIadrTaRb...
> (command "open" "U:\Standard Drawings\Standard AA\Folder B1\XOX.dwg")
>
>
> --
>
> Chip Harper
> Member of the AutoDesk Discussion Forum Moderator Program
>
>
>
Message 5 of 5
Anonymous
in reply to: Anonymous

Hi Laurie,

You are on the right track I think...as any drawing on that U drive IS, in
fact Read Only...

I will have to get deeper into this I think.

Regards,

DP

"Laurie Comerford" wrote in message
news:44DA8FB2B35E6FF9C94D7AB2AACD78A6@in.WebX.maYIadrTaRb...
> Hi David,
>
> An AutoCAD toolbar icon simply runs a script. Hence, all you need do is
> carefully duplicate the keystrokes you would type from the Keyboard to
> achieve the result you require. Simply replace the use of the key
> with semi-colons ";" but without the inverted commas.
>
> However, in this case there is a further difficulty in that the drawing
may
> be read-only which requires a different number of keystrokes. Hence you
> will need a program to detect if the file is read only and proceed
> accordingly.
>
> Here's a little extract from the help files on VBA
> Sub Example_ReadOnly()
> ' This example shows if current drawing file is read only or not
>
> If ThisDrawing.ReadOnly Then
> MsgBox "The current drawing file is read only.", , "ReadOnly
> Example"
> Else
> MsgBox "The current drawing file is read-write.", , "ReadOnly
> Example"
> End If
>
> End Sub-- Laurie ComerfordCADAppswww.cadapps.com.au"David Penney"
> wrote in message
> news:056FDA3D7622D421DD77C2D5A1C77D97@in.WebX.maYIadrTaRb...
> > Hi all,
> >
> > I have been checking google newsgroups trying to find a lisp or script
> that
> > I can use with a user-made toolbar button to open a certain drawing file
> in
> > AutoCad....
> >
> > In all the posts I have read over the past 3 days, I have yet to see a
> > complete and constant answer to the "opening a drawing" question.
> >
> > The drawing I want to open is say "XOX.dwg" on
> >
> > U:\Standard Drawings\Standard AA\Folder B1\
> >
> > What would I write either as a lisp or as a script/macro to open this
> > drawing....even if it is READ only, etc.?
> >
> > I am totally non-plussed with this one...
> >
> > Any help with this would be appreciated
> >
> > (BTW: SDI = 0 on normal settings)
> >
> > Regards,
> >
> > DP
> >
> >
>
>

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

Post to forums  

Autodesk Design & Make Report

”Boost