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

Old Lisp Routine

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
203 Views, 8 Replies

Old Lisp Routine

I am trying to make an old lisp routine work on 2005. It is from the residential plan template and it would insert a door and clean up the wall. I can get it to go as far as inserting the jamb and cleaning up the wall but it does not insert the door or swing. Instead it gives back the message "; error: bad argument type: numberp: nil." Does anyone have any suggestions as to what I am doing wrong?
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

It’s difficult to know without seeing the code, although the error "; error: bad argument type: numberp: nil." might suggest that one of your variables is not getting set and is therefore nil.

Dan
Message 3 of 9
Anonymous
in reply to: Anonymous

In my experience, that message usually comes not so much when a variable is
set to nil, but when the routine is expecting a numerical response to a
command sub-prompt or for use in a lisp function, and it is being fed a
variable with a value assigned to it that is not numerical (such as a text
string). It could be something wrong with the setting of that variable, or
it could be something that has changed in the command prompt sequence in
2005. The code of the routine, and where the error message comes, would be
helpful.
--
Kent Cooper


wrote...
I am trying to make an old lisp routine work on 2005. It is from the
residential plan template and it would insert a door and clean up the wall.
I can get it to go as far as inserting the jamb and cleaning up the wall but
it does not insert the door or swing. Instead it gives back the message ";
error: bad argument type: numberp: nil." Does anyone have any suggestions
as to what I am doing wrong?
Message 4 of 9
Anonymous
in reply to: Anonymous

Attached is the lisp routine. I warn you it is an AutoCAD protected lisp file so it may not help much (I hope this doesn't get me in any trouble! Ground rule #3 I am not advocating software piracy, I am merely looking for help). The command line is; ^c^c(pdoor "door1" "hgth" "/rpln/dr0_" 1) entering -1 rather than 1 mirrors the door so that only one block is needed rather than two (this is from back in version 9 of AutoCAD). I also forgot to mention, that what this does is start pdoor. Then it is supposed to display "door1" on the screen menu (which it does not do anymore) and prompts on the comand line to select the door width from the screen menu. I manually enter what it would normally enter if I picked it from the screen menu. Then it is supposed to display "hgth" on the screen menu (which it does not) so I manually enter that as well. It does break the wall to the correct width of the door opening and place the jambs then I get the error message and it does not place the door and swing.
Message 5 of 9
Anonymous
in reply to: Anonymous

See response to Dan
Message 6 of 9
Anonymous
in reply to: Anonymous

I can't read your attachment, but your description sounds as though you
haven't got the appropriate screen sub-menu(s) included in your larger
screen menu file, or the title part(s) of it/them [**door1 or something]
might be wrong. It could be that the item you would pick off that sub-menu
not only feeds in the door width, but also sets some other variable that you
won't get when you type in the width. THat could easily be the source of
your 'numberp nil' message.

And that sub-menu item probably also has the instructions [$S=hgth or
something] for calling up the height sub-menu (assuming that's what is meant
by 'hgth'), which again you won't get unless you pick the width from the
screen menu instead of typing it. The height selection menu items could
also be setting something else in addition to feeding in the height, so that
could also be where the 'numberp nil' message is coming from.

Loading the lisp routine itself in a new Version isn't enough if it uses the
screen menu -- you need to include the screen sub-menus that it calls for,
which surely in this case are not part of AutoCAD's menu file. I hope you
still have the earlier-version .MNU or .MNS file(s) to copy them from. But
it might be hard to know what to look for if you can't get into the lisp
contents in a readable way to find out what the sub-menus it wants are
actually called (they might not be called anything like 'door1' or 'hgth').
--
Kent Cooper


wrote...
Attached is the lisp routine. I warn you it is an AutoCAD protected lisp
file so it may not help much (I hope this doesn't get me in any trouble!
Ground rule #3 I am not advocating software piracy, I am merely looking for
help). The command line is; ^c^c(pdoor "door1" "hgth" "/rpln/dr0_" 1)
entering -1 rather than 1 mirrors the door so that only one block is needed
rather than two (this is from back in version 9 of AutoCAD). I also forgot
to mention, that what this does is start pdoo
r. Then it is supposed to display "door1" on the screen menu (which it does
not do anymore) and prompts on the comand line to select the door width from
the screen menu. I manually enter what it would normally enter if I picked
it from the screen menu. Then it is supposed to display "hgth" on the
screen menu (which it does not) so I manually enter that as well. It does
break the wall to the correct width of the door opening and place the jambs
then I get the error message and it d
oes not place the door and swing.
Message 7 of 9
Anonymous
in reply to: Anonymous

Sampling of the screen menu's are as follows:
**DOOR1 3

[ 1' 6" ]18;
[ 2' 0" ]24;
[ 2' 4" ]28;
[ 2' 6" ]30;
[ 2' 8" ]32;
[ 3' 0" ]36;
[ 3' 6" ]42;
[ 4' 0" ]48;

**HGTH 3

[ 6' 8" ]80;
[ 7' 0" ]84;
[ 7' 4" ]88;
[ 8' 0" ]96;

[ OTHER ]0;

So, selecting a 3'-0" door width (any height) inserts a block called DR0_36.dwg. See attached.
Message 8 of 9
Anonymous
in reply to: Anonymous

So the screen menu picks don't do anything other than feed in the sizes.
That doesn't help figure out the 'numberp nil' message....

But the fact that these don't show up when you use the routine should mean
that either:
- they're not a part of the current menu file you have loaded, or;
- whatever is supposed to call them up isn't working right (should have
language like $S=DOOR1 and $S=HGTH somewhere).

--
Kent Cooper


wrote...
Sampling of the screen menu's are as follows:
**DOOR1 3

[ 1' 6" ]18;
[ 2' 0" ]24;
[ 2' 4" ]28;
[ 2' 6" ]30;
[ 2' 8" ]32;
[ 3' 0" ]36;
[ 3' 6" ]42;
[ 4' 0" ]48;

**HGTH 3

[ 6' 8" ]80;
[ 7' 0" ]84;
[ 7' 4" ]88;
[ 8' 0" ]96;

[ OTHER ]0;

So, selecting a 3'-0" door width (any height) inserts a block called
DR0_36dwg. See attached.
Message 9 of 9
Anamarta
in reply to: Anonymous

does this lisp routine has its own folder? it may need some files like dwg, dcl, sld, or scn to run. try to add the folder into your autocad path (if not already done) . (Tool, Options, Files, Support File Search Path)

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

Post to forums  

Autodesk Design & Make Report

”Boost