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

Error message, Help I can't figure it out!

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
475 Views, 7 Replies

Error message, Help I can't figure it out!

When running a routine, the code below stops at the command "insert" line
and prints the
error shown below....If I re-run the code, the routine works fine... It
almost acts like it is looking for input
to the layer command.

Anyone have any thoughts why this would not work, then work just fine when
run again?
Thanks a million this one has me stumped!


;***** start of code ****
(setq sstemp (ssadd))
;**** insert lower die shoe threads ****
(setq temp inspt);just for testing

(tp "in draw_top_view_balance_block tp300")
(command "insert" "THX5-16-18" "non" inspt "" "" "")

(tp "in draw_top_view_balance_block tp310")
(setq ent (entlast))
(ssadd ent sstemp)

(tp "in draw_top_view_balance_block tp340")

(if ent
(command "change" ent "" "P" "layer" "lds" "")
(notify "in draw_top_view_balance_blocks and there is no ent")
)

;****end of code ****


Invalid option keyword.
; error: Function cancelled
[?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/Plot/Freeze/Thaw/LOck/Unlock/stAte]:




--
Bob Q
Pentium 4 3.33 GHz
1GB RAM
XP Pro SP2
ATI Mobility Radeon 9000 IGP graphics.....
MDT 2004DX
7 REPLIES 7
Message 2 of 8
curmudgeon
in reply to: Anonymous

I copied and pasted, and looked up ssadd, which I had never used before. the code you showed has nothing I see to evoke a layer command to fail with a layer error message.

however, it looks like you have ( tp ) defined as a subroutine, maybe in a setup generic subroutine.
is it possible that ( tp ) is somehow looking for some sort of layer input and not finding it?

??
Message 3 of 8
Anonymous
in reply to: Anonymous


 don't think it is the tp command, all it does
is print out the test point text.... and I have tried with and without the tp's
in place...

 

I am almost thinking it is something to do with the
insert command, possibly it is being called in another routine, that is goofing
up the variables in it or something.... I have run into problems with the text
command before i.e. how you use it changes the prompts it displays, but never
with the insert command...

 

Bummer, I think I will just run it at a different
time, so that it will work.  not a good solution but o.k. for
now.

Thanks for your help!

 

I posted earlier, and somehow lost the post, now
found it, a couple people had some thoughts there, I will investigate
further...

Thanks again! -B

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
----- Original Message -----


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I
copied and pasted, and looked up ssadd, which I had never used before. the
code you showed has nothing I see to evoke a layer command to fail with a
layer error message. however, it looks like you have ( tp ) defined as a
subroutine, maybe in a setup generic subroutine. is it possible that ( tp ) is
somehow looking for some sort of layer input and not finding it?
??
Message 4 of 8
curmudgeon
in reply to: Anonymous

I don't mean to be a snob, except I know what is important to me. if there is the "command" command in my code, it means I am not done yet. I tell myself that there is some real benefit this way - if they change the syntax of the command in a future version I am covered.

this does not need to be true - really, I just like it my way.

but, this thing I am working on presently, it is taking every trick I know and I am having to learn more. in other words, I am in hog heaven. I need the areas of very many polygons, and I coded my own area command, which I needed to calculate the centroid. LWPOLY's do not have a centroid, and if autocad has an implied centroid, I missed it.

I guess I just want to be encouraging. doing it the hard way has it's benefit, just hard to bill for.....

:)
Message 5 of 8
Anonymous
in reply to: Anonymous

Bob:

> (command "change" ent "" "P" "layer" "lds" "")

Focus on this line of code. 🙂
--
Owen Wengerd
President, ManuSoft <>
VP Americas, CADLock, Inc. <>
Message 6 of 8
Anonymous
in reply to: Anonymous

Thanks Owen, I put a (command) statement at the begining of the routine, and
the problem went away......

Not sure why but it works.


"Owen Wengerd" wrote in message
news:6142453@discussion.autodesk.com...
Bob:

> (command "change" ent "" "P" "layer" "lds" "")

Focus on this line of code. 🙂
--
Owen Wengerd
President, ManuSoft <>
VP Americas, CADLock, Inc. <>
Message 7 of 8
curmudgeon
in reply to: Anonymous

Hi Bob - I see it now. when I see command in lisp my eyes glaze over. hard to see that way.
the command command is echoing input as if you had typed it.
but in lisp, I don't know of a way to re-invoke the command all in one line.
or, it makes sense that you would need another command in front of "layer".

anyway, glad you have something that works.

roy
Message 8 of 8
Anonymous
in reply to: Anonymous

Bob:

The (command) works because it cancels the pending command. Better would
be to fix the code so that no command is left pending. Try entering your
commands manually and you should be able to spot the error quickly. 🙂
--
Owen Wengerd
President, ManuSoft <>
VP Americas, CADLock, Inc. <>


"Bob Quinn" wrote in message
news:6142478@discussion.autodesk.com...
Thanks Owen, I put a (command) statement at the begining of the routine, and
the problem went away......

Not sure why but it works.

[...]

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

Post to forums  

Autodesk Design & Make Report

”Boost