Some Lisp Routines Won't Work

Some Lisp Routines Won't Work

Anonymous
Not applicable
222 Views
9 Replies
Message 1 of 10

Some Lisp Routines Won't Work

Anonymous
Not applicable
Hello;
We just upgraded to A2K, and forgive me if this question has come up before
(I couldn't find one though).

Some of our lisp routines, which worked fine in AutoCAD 14, do not work with
A2K, specially ones with command line "INSERT" i.e. Command "INSERT" "bla
bla bla".

Is there any changes that we need to know? Can you give us a hint? Thanks!

m.aaly@ssss.com
0 Likes
223 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
You need to prefix "INSERT" with "-" to ensure that
the command - line version of INSERT is used. There's
plenty of other gotcha's, but it's best to take 'em
one at a time.

poor wrote:
>
> Hello;
> We just upgraded to A2K, and forgive me if this question has come up before
> (I couldn't find one though).
>
> Some of our lisp routines, which worked fine in AutoCAD 14, do not work with
> A2K, specially ones with command line "INSERT" i.e. Command "INSERT" "bla
> bla bla".
>
> Is there any changes that we need to know? Can you give us a hint? Thanks!
>
> m.aaly@ssss.com

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 3 of 10

Anonymous
Not applicable
Thanks Tony for your reply.
I put a "-" in front of the word "INSERT". Still doesn't work right. It
asks the user for x, then y, and then z, a.....
Here is the code we have from R14:

(defun NEW_ERR (s)
(if (/= s "Function cancelled")
(princ (strcat "\nError: "s))
)
(setq *error* OLD_ERR)
(princ)
)
(defun C:CEN ()
(setq OLD_ERR *error* *error* NEW_ERR)
(setvar "CMDECHO" 0)
(setvar "ATTDIA" 1)
(setq scalef (* 1.12 (getvar "dimscale")))
(setq A (getpoint "\nSelect insertion point: "))
(command "-INSERT" "ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "")
(setq *error* OLD_ERR)
(princ)
)
(princ " CENTER LINE routine loaded ")
(princ)

Can you please shed some light in to this.

Regards;
m.aaly@ssss.com

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Tony Tanzillo wrote in message
news:38D05B96.5FDF33B2@worldnet.att.net...
> You need to prefix "INSERT" with "-" to ensure that
> the command - line version of INSERT is used. There's
> plenty of other gotcha's, but it's best to take 'em
> one at a time.
>
> poor wrote:
> >
> > Hello;
> > We just upgraded to A2K, and forgive me if this question has come up
before
> > (I couldn't find one though).
> >
> > Some of our lisp routines, which worked fine in AutoCAD 14, do not work
with
> > A2K, specially ones with command line "INSERT" i.e. Command "INSERT"
"bla
> > bla bla".
> >
> > Is there any changes that we need to know? Can you give us a hint?
Thanks!
> >
> > m.aaly@ssss.com
>
> --
> /*********************************************************/
> /* Tony Tanzillo Design Automation Consulting */
> /* Programming & Customization for AutoCAD & Compatibles */
> /* ----------------------------------------------------- */
> /* tony.tanzillo@worldnet.att.net */
> /* http://ourworld.compuserve.com/homepages/tonyt */
> /*********************************************************/
0 Likes
Message 4 of 10

Anonymous
Not applicable
Hi,

That's right, the insert command did change. I experienced this when using the
(vla-InsertBlock) function which requires an extra parameter for the z-scale in
A2K.

Simply add "" to the end of your insert command so it becomes:

(command "-INSERT" "ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "" "")

This should apply the same x-scale to y and z as well. Although I've found many
differences in the way ActiveX functions are handled in A2K, this is the only
command I know of which has changed. I'm sure someone else could shed light on
any others.

Good luck!

Andrew Wilford
visualdcl@mindspring.com

Visual DCL v1.0
http://www.mindspring.com/~cwilford/visualdcl.htm
------------Millennium special $89.95!-----------
0 Likes
Message 5 of 10

Anonymous
Not applicable
You're going to have to be more specific about the
problem, because I don't see any problem with the
code below.

Change the 0 in (setvar "cmdecho" 0) to 1, and then
run your code. Copy the output from the text window
and post it in a reply here.

"m.a." wrote:
>
> Thanks Tony for your reply.
> I put a "-" in front of the word "INSERT". Still doesn't work right. It
> asks the user for x, then y, and then z, a.....
> Here is the code we have from R14:
>
> (defun NEW_ERR (s)
> (if (/= s "Function cancelled")
> (princ (strcat "\nError: "s))
> )
> (setq *error* OLD_ERR)
> (princ)
> )
> (defun C:CEN ()
> (setq OLD_ERR *error* *error* NEW_ERR)
> (setvar "CMDECHO" 0)
> (setvar "ATTDIA" 1)
> (setq scalef (* 1.12 (getvar "dimscale")))
> (setq A (getpoint "\nSelect insertion point: "))
> (command "-INSERT" "ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "")
> (setq *error* OLD_ERR)
> (princ)
> )
> (princ " CENTER LINE routine loaded ")
> (princ)
>
> Can you please shed some light in to this.
>
> Regards;
> m.aaly@ssss.com
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> Tony Tanzillo wrote in message
> news:38D05B96.5FDF33B2@worldnet.att.net...
> > You need to prefix "INSERT" with "-" to ensure that
> > the command - line version of INSERT is used. There's
> > plenty of other gotcha's, but it's best to take 'em
> > one at a time.
> >
> > poor wrote:
> > >
> > > Hello;
> > > We just upgraded to A2K, and forgive me if this question has come up
> before
> > > (I couldn't find one though).
> > >
> > > Some of our lisp routines, which worked fine in AutoCAD 14, do not work
> with
> > > A2K, specially ones with command line "INSERT" i.e. Command "INSERT"
> "bla
> > > bla bla".
> > >
> > > Is there any changes that we need to know? Can you give us a hint?
> Thanks!
> > >
> > > m.aaly@ssss.com
> >
> > --
> > /*********************************************************/
> > /* Tony Tanzillo Design Automation Consulting */
> > /* Programming & Customization for AutoCAD & Compatibles */
> > /* ----------------------------------------------------- */
> > /* tony.tanzillo@worldnet.att.net */
> > /* http://ourworld.compuserve.com/homepages/tonyt */
> > /*********************************************************/

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 6 of 10

Anonymous
Not applicable
I don't believe there's any need to include the Z scale
factor, unless you type "XYZ" at the X scale factor
prompt.

Andrew Wilford wrote:
>
> Hi,
>
> That's right, the insert command did change. I experienced this when using the
> (vla-InsertBlock) function which requires an extra parameter for the z-scale in
> A2K.
>
> Simply add "" to the end of your insert command so it becomes:
>
> (command "-INSERT" "ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "" "")
>
> This should apply the same x-scale to y and z as well. Although I've found many
> differences in the way ActiveX functions are handled in A2K, this is the only
> command I know of which has changed. I'm sure someone else could shed light on
> any others.
>
> Good luck!
>
> Andrew Wilford
> visualdcl@mindspring.com
>
> Visual DCL v1.0
> http://www.mindspring.com/~cwilford/visualdcl.htm
> ------------Millennium special $89.95!-----------

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 7 of 10

Anonymous
Not applicable
hi;

 

Here is the copy&paste of text window:

 

Command: cen

Initializing... CENTER LINE routine loaded
Select insertion
point: -INSERT Enter block name or [?]:
ZZ/Ylib/std/mech/Misc/Misc_21

Specify insertion point or
[Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]:
Enter X scale factor, specify
opposite corner, or [Corner/XYZ] <1>:
1.120000000000000 Enter Y scale
factor <use X scale factor>: Specify rotation
angle
<0>:
Enter attribute values
Enter first description line (if any):
Enter seond description line (if any):
Enter third description line (if
any):
Command:

 

As you can see, for some reason, there is no pause and
requirement for user input of "attribute" values.  Something is setting
them to blank and continues (block misc_21 has three lines of attribute first
line, second line, and third line).

 

In this line (command "-INSERT"
"ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "" "" "")
  if I
remove two of double quotes, "" "", and leave it as (command
"-INSERT" "ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "" ),

then program pauses and asks for Y and Z values?  I am so
confused.

 

Please, this was working fine with release 14.  What in
the world did Autodesk do.

 

Thanks for your help. 

 


size=2>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


size=2>> You're going to have to be more specific about the
> problem,
because I don't see any problem with the
> code below.
>
>
Change the 0 in (setvar "cmdecho" 0) to 1, and then
> run your code. Copy
the output from the text window
> and post it in a reply here.
>

> "m.a." wrote:
> >
> > Thanks Tony for your
reply.
> > I put a "-" in front of the word "INSERT".   Still
doesn't work right.  It
> > asks the user for x, then y, and then
z, a.....
> > Here is the code we have from R14:
> >
>
> (defun NEW_ERR (s)
> >  (if (/= s "Function
cancelled")
> >      (princ (strcat "\nError:
"s))
> >  )
> >  (setq *error* OLD_ERR)
>
>  (princ)
> > )
> > (defun C:CEN ()
>
>  (setq OLD_ERR *error* *error* NEW_ERR)
> >  (setvar
"CMDECHO" 0)
> >  (setvar "ATTDIA" 1)
> >  (setq
scalef (* 1.12 (getvar "dimscale")))
> >  (setq A (getpoint
"\nSelect insertion point: "))
> >  (command "-INSERT"
"ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "" "" "")
> >  (setq
*error* OLD_ERR)
> >  (princ)
> > )
> > (princ "
CENTER LINE routine loaded ")
> > (princ)
> >
> >
Can you please shed some light in to this.
> >
> >
Regards;
> >
href="mailto:m.aaly@ssss.com">m.aaly@ssss.com

> >
> >
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
>
> > Tony Tanzillo <
href="mailto:tony.tanzillo@worldnet.att.net">tony.tanzillo@worldnet.att.net
>
wrote in message
> >
href="news:38D05B96.5FDF33B2@worldnet.att.net">news:38D05B96.5FDF33B2@worldnet.att.net
...
>
> > You need to prefix "INSERT" with "-" to ensure that
> > >
the command - line version of INSERT is used. There's
> > > plenty
of other gotcha's, but it's best to take 'em
> > > one at a
time.
> > >
> > > poor wrote:
> > >
>
> > > > Hello;
> > > > We just upgraded to
A2K, and forgive me if this question has come up
> > before
>
> > > (I couldn't find one though).
> > > >
> >
> > Some of our lisp routines, which worked fine in AutoCAD 14, do not
work
> > with
> > > > A2K, specially ones with command
line "INSERT" i.e. Command "INSERT"
> > "bla
> > > > bla
bla".
> > > >
> > > > Is there any changes that we
need to know?  Can you give us a hint?
> > Thanks!
> >
> >
> > > >
href="mailto:m.aaly@ssss.com">m.aaly@ssss.com

> > >
> >
> --
> > >
/*********************************************************/
> > >
/*    Tony Tanzillo     Design Automation
Consulting     */
> > > /* Programming &
Customization for AutoCAD & Compatibles */
> > > /*
----------------------------------------------------- */
> > >
/*           
href="mailto:tony.tanzillo@worldnet.att.net">tony.tanzillo@worldnet.att.net
            
*/
> > > /*   
href="http://ourworld.compuserve.com/homepages/tonyt">http://ourworld.compuserve.com/homepages/tony...
    
*/
> > >
/*********************************************************/
>
> --

> /*********************************************************/
>
/*    Tony Tanzillo     Design Automation
Consulting     */
> /* Programming & Customization
for AutoCAD & Compatibles */
> /*
----------------------------------------------------- */
>
/*           
href="mailto:tony.tanzillo@worldnet.att.net">tony.tanzillo@worldnet.att.net
            
*/
> /*   
href="http://ourworld.compuserve.com/homepages/tonyt">http://ourworld.compuserve.com/homepages/tony...
    
*/
>
/*********************************************************/
0 Likes
Message 8 of 10

Anonymous
Not applicable
Try changing your "ATTREQ" system variable.

-mjm

On Thu, 16 Mar 2000 16:06:37 -0600, "m.a." wrote:

>hi;
>
>Here is the copy&paste of text window:
>
>Command: cen
>Initializing... CENTER LINE routine loaded
>Select insertion point: -INSERT Enter block name or [?]: ZZ/Ylib/std/mech/Misc/Misc_21
>Specify insertion point or [Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]:
>Enter X scale factor, specify opposite corner, or [Corner/XYZ] <1>:
>1.120000000000000 Enter Y scale factor : Specify rotation
>angle <0>:
>Enter attribute values
>Enter first description line (if any): Enter seond description line (if any):
>Enter third description line (if any):
>Command:
>
>As you can see, for some reason, there is no pause and requirement for user input of "attribute" values. Something is setting them to blank and continues (block misc_21 has three lines of attribute first line, second line, and third line).
>
>In this line (command "-INSERT" "ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "" "" "") if I remove two of double quotes, "" "", and leave it as (command "-INSERT" "ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "" ), then program pauses and asks for Y and Z values? I am so confused.
>
>Please, this was working fine with release 14. What in the world did Autodesk do.
>
>Thanks for your help.
>
>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>Tony Tanzillo wrote in message news:38D12860.8FA478B8@worldnet.att.net...
>> You're going to have to be more specific about the
>> problem, because I don't see any problem with the
>> code below.
>>
>> Change the 0 in (setvar "cmdecho" 0) to 1, and then
>> run your code. Copy the output from the text window
>> and post it in a reply here.
>>
>> "m.a." wrote:
>> >
>> > Thanks Tony for your reply.
>> > I put a "-" in front of the word "INSERT". Still doesn't work right. It
>> > asks the user for x, then y, and then z, a.....
>> > Here is the code we have from R14:
>> >
>> > (defun NEW_ERR (s)
>> > (if (/= s "Function cancelled")
>> > (princ (strcat "\nError: "s))
>> > )
>> > (setq *error* OLD_ERR)
>> > (princ)
>> > )
>> > (defun C:CEN ()
>> > (setq OLD_ERR *error* *error* NEW_ERR)
>> > (setvar "CMDECHO" 0)
>> > (setvar "ATTDIA" 1)
>> > (setq scalef (* 1.12 (getvar "dimscale")))
>> > (setq A (getpoint "\nSelect insertion point: "))
>> > (command "-INSERT" "ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "" "" "")
>> > (setq *error* OLD_ERR)
>> > (princ)
>> > )
>> > (princ " CENTER LINE routine loaded ")
>> > (princ)
>> >
>> > Can you please shed some light in to this.
>> >
>> > Regards;
>> > m.aaly@ssss.com
>> >
>> > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>> >
>> > Tony Tanzillo wrote in message
>> > news:38D05B96.5FDF33B2@worldnet.att.net...
>> > > You need to prefix "INSERT" with "-" to ensure that
>> > > the command - line version of INSERT is used. There's
>> > > plenty of other gotcha's, but it's best to take 'em
>> > > one at a time.
>> > >
>> > > poor wrote:
>> > > >
>> > > > Hello;
>> > > > We just upgraded to A2K, and forgive me if this question has come up
>> > before
>> > > > (I couldn't find one though).
>> > > >
>> > > > Some of our lisp routines, which worked fine in AutoCAD 14, do not work
>> > with
>> > > > A2K, specially ones with command line "INSERT" i.e. Command "INSERT"
>> > "bla
>> > > > bla bla".
>> > > >
>> > > > Is there any changes that we need to know? Can you give us a hint?
>> > Thanks!
>> > > >
>> > > > m.aaly@ssss.com
>> > >
>> > > --
>> > > /*********************************************************/
>> > > /* Tony Tanzillo Design Automation Consulting */
>> > > /* Programming & Customization for AutoCAD & Compatibles */
>> > > /* ----------------------------------------------------- */
>> > > /* tony.tanzillo@worldnet.att.net */
>> > > /* http://ourworld.compuserve.com/homepages/tonyt */
>> > > /*********************************************************/
>>
>> --
>> /*********************************************************/
>> /* Tony Tanzillo Design Automation Consulting */
>> /* Programming & Customization for AutoCAD & Compatibles */
>> /* ----------------------------------------------------- */
>> /* tony.tanzillo@worldnet.att.net */
>> /* http://ourworld.compuserve.com/homepages/tonyt */
>> /*********************************************************/
0 Likes
Message 9 of 10

Anonymous
Not applicable
Hey there!

We experienced a similar problem with our section mark routine. Our
routine inserts a block for a section mark. The block contains a circle
with a line across the centre and two attributes. Below is the code
that works for us in AutoCAD 2000. I thought it might help:

; insert circle part with section number and sheet number
(setvar "cmdecho" 1)
(setq sectnum (getstring "Section Number? (1) "))
(setq dwgnum (getstring "Drawing Number? (S2) "))
(setq sectins (getpoint "Insertion Point? "))
(setvar "cmdecho" 0)
(command "INSERT" "SECTMARK" "SCALE" sf sectins "0" sectnum dwgnum)

Basically, we gather the input from the user first, and then issue the
Insert command.

Good luck!

Martin

"m.a." wrote:

> hi; Here is the copy&paste of text window: Command: cenInitializing...
> CENTER LINE routine loaded
> Select insertion point: -INSERT Enter block name or [?]:
> ZZ/Ylib/std/mech/Misc/Misc_21Specify insertion point or
> [Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]:
> Enter X scale factor, specify opposite corner, or [Corner/XYZ] <1>:
> 1.120000000000000 Enter Y scale factor : Specify
> rotation
> angle <0>:
> Enter attribute values
> Enter first description line (if any): Enter seond description line
> (if any):
> Enter third description line (if any):
> Command: As you can see, for some reason, there is no pause and
> requirement for user input of "attribute" values. Something is
> setting them to blank and continues (block misc_21 has three lines of
> attribute first line, second line, and third line). In this line
> (command "-INSERT" "ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "" ""
> "") if I remove two of double quotes, "" "", and leave it as (command
> "-INSERT" "ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "" ), then
> program pauses and asks for Y and Z values? I am so confused. Please,
> this was working fine with release 14. What in the world did Autodesk
> do. Thanks for your help.
0 Likes
Message 10 of 10

Anonymous
Not applicable
Thanks for all of you wonderful people for helping out. Every little line
helped. Thanks.
I think we have got it now working in a way. I had to add (command "DDATTE"
"l") in order to open attribute dialog box.

"Martin Klingbeil" wrote in message
news:38D25276.F172E5EC@walterschambers.com...
> Hey there!
>
> We experienced a similar problem with our section mark routine. Our
> routine inserts a block for a section mark. The block contains a circle
> with a line across the centre and two attributes. Below is the code
> that works for us in AutoCAD 2000. I thought it might help:
>
> ; insert circle part with section number and sheet number
> (setvar "cmdecho" 1)
> (setq sectnum (getstring "Section Number? (1) "))
> (setq dwgnum (getstring "Drawing Number? (S2) "))
> (setq sectins (getpoint "Insertion Point? "))
> (setvar "cmdecho" 0)
> (command "INSERT" "SECTMARK" "SCALE" sf sectins "0" sectnum dwgnum)
>
> Basically, we gather the input from the user first, and then issue the
> Insert command.
>
> Good luck!
>
> Martin
>
> "m.a." wrote:
>
> > hi; Here is the copy&paste of text window: Command: cenInitializing...
> > CENTER LINE routine loaded
> > Select insertion point: -INSERT Enter block name or [?]:
> > ZZ/Ylib/std/mech/Misc/Misc_21Specify insertion point or
> > [Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]:
> > Enter X scale factor, specify opposite corner, or [Corner/XYZ] <1>:
> > 1.120000000000000 Enter Y scale factor : Specify
> > rotation
> > angle <0>:
> > Enter attribute values
> > Enter first description line (if any): Enter seond description line
> > (if any):
> > Enter third description line (if any):
> > Command: As you can see, for some reason, there is no pause and
> > requirement for user input of "attribute" values. Something is
> > setting them to blank and continues (block misc_21 has three lines of
> > attribute first line, second line, and third line). In this line
> > (command "-INSERT" "ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "" ""
> > "") if I remove two of double quotes, "" "", and leave it as (command
> > "-INSERT" "ZZ/Ylib/std/mech/Misc/Misc_21" A scalef "" "" ), then
> > program pauses and asks for Y and Z values? I am so confused. Please,
> > this was working fine with release 14. What in the world did Autodesk
> > do. Thanks for your help.
>
0 Likes