Check "measurement" var. on dwg open

Check "measurement" var. on dwg open

Anonymous
Not applicable
303 Views
7 Replies
Message 1 of 8

Check "measurement" var. on dwg open

Anonymous
Not applicable
Having discovered that drawings recovered after a crash ALWAYS have
MEASUREMENT set to "0",

I have been trying to get a little bit of lisp to check the status of
MEASUREMENT and, if it is not "1", prompt the user if he/she wants to change
it.

I have tried putting the routine in acaddoc.lsp, as partof S::STARTUP, and
in acad.lsp. I have been able to get the routine to run, but it does not
wait for the user to respond to the prompt.

Can anyone elighten me?

thanks

Keith P.

Balston & Company
0 Likes
304 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Good intentions but it might be annoying to be prompted to change
MEASUREMENT for every valid setting of 0.

"Keith Pocock" wrote in message
news:[email protected]...
> Having discovered that drawings recovered after a crash ALWAYS have
> MEASUREMENT set to "0",
>
> I have been trying to get a little bit of lisp to check the status of
> MEASUREMENT and, if it is not "1", prompt the user if he/she wants to
change
> it.
>
> I have tried putting the routine in acaddoc.lsp, as partof S::STARTUP, and
> in acad.lsp. I have been able to get the routine to run, but it does not
> wait for the user to respond to the prompt.
>
> Can anyone elighten me?
>
>
> thanks
>
> Keith P.
>
> Balston & Company
>
>
0 Likes
Message 3 of 8

Anonymous
Not applicable
Frank

He may be trying to set the undocmented measureinit variable since he's in
the UK.

"Frank Oquendo" wrote in message
news:[email protected]...
> Good intentions but it might be annoying to be prompted to change
> MEASUREMENT for every valid setting of 0.
>
> "Keith Pocock" wrote in message
> news:[email protected]...
> > Having discovered that drawings recovered after a crash ALWAYS have
> > MEASUREMENT set to "0",
> >
> > I have been trying to get a little bit of lisp to check the status of
> > MEASUREMENT and, if it is not "1", prompt the user if he/she wants to
> change
> > it.
> >
> > I have tried putting the routine in acaddoc.lsp, as partof S::STARTUP,
and
> > in acad.lsp. I have been able to get the routine to run, but it does not
> > wait for the user to respond to the prompt.
> >
> > Can anyone elighten me?
> >
> >
> > thanks
> >
> > Keith P.
> >
> > Balston & Company
> >
> >
>
>
0 Likes
Message 4 of 8

Anonymous
Not applicable
As I see it, Frank, and I may be nearsighted:-). There are only two valid
settings for Measurement. Measurement = 1 means the drawing is a metric
(mm) drawing. Measurement = 0 means it is note.

For those who haven't run into this. When measurement = 1, Acad uses the
metric versions of acad.pat and acad.lin.

--
==============================
Michael Weaver
By day: Charles Bettisworth & Co.
[email protected]
By night: AlasCAD
[email protected]
AOL Instant messenger screen name:
AlasCAD
AUGI #w2170
==============================

"Frank Oquendo" wrote in message
news:[email protected]...
> Good intentions but it might be annoying to be prompted to change
> MEASUREMENT for every valid setting of 0.
>
> "Keith Pocock" wrote in message
> news:[email protected]...
> > Having discovered that drawings recovered after a crash ALWAYS have
> > MEASUREMENT set to "0",
> >
> > I have been trying to get a little bit of lisp to check the status of
> > MEASUREMENT and, if it is not "1", prompt the user if he/she wants to
> change
> > it.
> >
> > I have tried putting the routine in acaddoc.lsp, as partof S::STARTUP,
and
> > in acad.lsp. I have been able to get the routine to run, but it does not
> > wait for the user to respond to the prompt.
> >
> > Can anyone elighten me?
> >
> >
> > thanks
> >
> > Keith P.
> >
> > Balston & Company
> >
> >
>
>
0 Likes
Message 5 of 8

Anonymous
Not applicable
Keith,

You might want to consider doing the following.

Within the s::startup add the following:
(if (findfile "autoload.lsp")(load (findfile "autoload.lsp")))

Then in the drawing directory for metric drawings create an autoload.lsp
file. Set all of your project specific settings in this file. I often use
this as a pseudo script by placing commands that update things like the
title block drawn date. I never have to worry about having the wrong date
on my drawings after doing this.

==============================
Michael Weaver
By day: Charles Bettisworth & Co.
[email protected]
By night: AlasCAD
[email protected]
AOL Instant messenger screen name:
AlasCAD
AUGI #w2170
==============================

"Keith Pocock" wrote in message
news:[email protected]...
> Having discovered that drawings recovered after a crash ALWAYS have
> MEASUREMENT set to "0",
>
> I have been trying to get a little bit of lisp to check the status of
> MEASUREMENT and, if it is not "1", prompt the user if he/she wants to
change
> it.
>
> I have tried putting the routine in acaddoc.lsp, as partof S::STARTUP, and
> in acad.lsp. I have been able to get the routine to run, but it does not
> wait for the user to respond to the prompt.
>
> Can anyone elighten me?
>
>
> thanks
>
> Keith P.
>
> Balston & Company
>
>
0 Likes
Message 6 of 8

Anonymous
Not applicable
Frank and Mike - thanks for the replies
Yes I am in the UK and ALL our drawings are metric (you know we dumped that
querky Imperial stuff years ago )
Hence it is very annoying to find that drawings recovered after a crash have
been reset to Imperial. It often goes unnoticed until a user cannot figure
out why hatches/linetypes are behaving strangely.
I have gone to the extreme of removing ACAD.PAT and ACAD.LIN from the search
paths (leaving the ISO versions in place), then the user gets notified that
MEASUREMENT is incorrect by a file not found error when hatching or
importing linetypes.

So yes, I _really_ do want to be notified if a drawing I have opened is
Imperial.

And what's the best way to achieve it please!!

thanks

Keith

"Frank Oquendo" wrote in message
news:[email protected]...
> Good intentions but it might be annoying to be prompted to change
> MEASUREMENT for every valid setting of 0.
>
> "Keith Pocock" wrote in message
> news:[email protected]...
> > Having discovered that drawings recovered after a crash ALWAYS have
> > MEASUREMENT set to "0",
> >
> > I have been trying to get a little bit of lisp to check the status of
> > MEASUREMENT and, if it is not "1", prompt the user if he/she wants to
> change
> > it.
> >
> > I have tried putting the routine in acaddoc.lsp, as partof S::STARTUP,
and
> > in acad.lsp. I have been able to get the routine to run, but it does not
> > wait for the user to respond to the prompt.
> >
> > Can anyone elighten me?
> >
> >
> > thanks
> >
> > Keith P.
> >
> > Balston & Company
> >
> >
>
>
0 Likes
Message 7 of 8

Anonymous
Not applicable
Well, for notification you could include this at the end of your acad.lsp
or acaddoc.lsp S::Startup

(if (= 0 (getvar "measurement")) (alert "This drawing is Imperial"))

If you want to automatically change it to Metric, you could use:

(if (= 0 (getvar "measurement")) (setvar "measurement" 1))

Or to go further, you could do both by using:

(if (= 0 (getvar "measurement")) (progn
(alert "This drawing is Imperial . . . .\nAnd will be changed to Metric.
")
(setvar "measurement" 1)
) )

FD

Keith Pocock wrote in article
<[email protected]>...
> Frank and Mike - thanks for the replies
> Yes I am in the UK and ALL our drawings are metric (you know we dumped
that
> querky Imperial stuff years ago )
> Hence it is very annoying to find that drawings recovered after a crash
have
> been reset to Imperial. It often goes unnoticed until a user cannot
figure
> out why hatches/linetypes are behaving strangely.
> I have gone to the extreme of removing ACAD.PAT and ACAD.LIN from the
search
> paths (leaving the ISO versions in place), then the user gets notified
that
> MEASUREMENT is incorrect by a file not found error when hatching or
> importing linetypes.
>
> So yes, I _really_ do want to be notified if a drawing I have opened is
> Imperial.
>
> And what's the best way to achieve it please!!
>
> thanks
>
> Keith
>
>
> "Frank Oquendo" wrote in message
> news:[email protected]...
> > Good intentions but it might be annoying to be prompted to change
> > MEASUREMENT for every valid setting of 0.
> >
> > "Keith Pocock" wrote in message
> > news:[email protected]...
> > > Having discovered that drawings recovered after a crash ALWAYS have
> > > MEASUREMENT set to "0",
> > >
> > > I have been trying to get a little bit of lisp to check the status of
> > > MEASUREMENT and, if it is not "1", prompt the user if he/she wants to
> > change
> > > it.
> > >
> > > I have tried putting the routine in acaddoc.lsp, as partof
S::STARTUP,
> and
> > > in acad.lsp. I have been able to get the routine to run, but it does
not
> > > wait for the user to respond to the prompt.
> > >
> > > Can anyone elighten me?
> > >
> > >
> > > thanks
> > >
> > > Keith P.
> > >
> > > Balston & Company
> > >
> > >
> >
> >
>
>
>
0 Likes
Message 8 of 8

Anonymous
Not applicable
Thank you.
Will I be able to even further and offer the user the option with a Y/N
question, I wonder.

I'll try it and see......

Regards,

Keith P.

"Flitter Dee" wrote in message
news:01bf5e01$a995ac80$d557d2d0@lms-1...
> Well, for notification you could include this at the end of your acad.lsp
> or acaddoc.lsp S::Startup
>
> (if (= 0 (getvar "measurement")) (alert "This drawing is Imperial"))
>
> If you want to automatically change it to Metric, you could use:
>
> (if (= 0 (getvar "measurement")) (setvar "measurement" 1))
>
> Or to go further, you could do both by using:
>
> (if (= 0 (getvar "measurement")) (progn
> (alert "This drawing is Imperial . . . .\nAnd will be changed to Metric.
> ")
> (setvar "measurement" 1)
> ) )
>
> FD
>
> Keith Pocock wrote in article
> <[email protected]>...
> > Frank and Mike - thanks for the replies
> > Yes I am in the UK and ALL our drawings are metric (you know we dumped
> that
> > querky Imperial stuff years ago )
> > Hence it is very annoying to find that drawings recovered after a crash
> have
> > been reset to Imperial. It often goes unnoticed until a user cannot
> figure
> > out why hatches/linetypes are behaving strangely.
> > I have gone to the extreme of removing ACAD.PAT and ACAD.LIN from the
> search
> > paths (leaving the ISO versions in place), then the user gets notified
> that
> > MEASUREMENT is incorrect by a file not found error when hatching or
> > importing linetypes.
> >
> > So yes, I _really_ do want to be notified if a drawing I have opened is
> > Imperial.
> >
> > And what's the best way to achieve it please!!
> >
> > thanks
> >
> > Keith
> >
> >
> > "Frank Oquendo" wrote in message
> > news:[email protected]...
> > > Good intentions but it might be annoying to be prompted to change
> > > MEASUREMENT for every valid setting of 0.
> > >
> > > "Keith Pocock" wrote in message
> > > news:[email protected]...
> > > > Having discovered that drawings recovered after a crash ALWAYS have
> > > > MEASUREMENT set to "0",
> > > >
> > > > I have been trying to get a little bit of lisp to check the status
of
> > > > MEASUREMENT and, if it is not "1", prompt the user if he/she wants
to
> > > change
> > > > it.
> > > >
> > > > I have tried putting the routine in acaddoc.lsp, as partof
> S::STARTUP,
> > and
> > > > in acad.lsp. I have been able to get the routine to run, but it does
> not
> > > > wait for the user to respond to the prompt.
> > > >
> > > > Can anyone elighten me?
> > > >
> > > >
> > > > thanks
> > > >
> > > > Keith P.
> > > >
> > > > Balston & Company
> > > >
> > > >
> > >
> > >
> >
> >
> >
0 Likes