Discussion Groups

All Discussion Groups » Visual LISP, AutoLISP and General Customization Issues

Thread: Stumped on intermitant error.....


Permlink Replies: 3 - Last Post: Mar 14, 2009 3:52 PM Last Post By: Bob Quinn
Bob Quinn
Stumped on intermitant error.....
Posted: Mar 13, 2009 11:05 PM
  Click to reply to this thread Reply
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
Doug Broad
Re: Stumped on intermitant error.....
Posted: Mar 14, 2009 1:16 PM   in response to: Bob Quinn in response to: Bob Quinn
  Click to reply to this thread Reply
Bob,
Hint
1) What command is the error prompting for?
2) Do you have that command in your posted code?
Why should people bother reading code that doesn't include the problem
command?

Rule
**ALWAYS** post sub-functions.


"Bob Quinn" wrote in message
news:6142280@discussion.autodesk.com...
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
EC-CAD

Posts: 5,923
Registered: 12/12/03
Re: Stumped on intermitant error.....
Posted: Mar 14, 2009 2:17 PM   in response to: Bob Quinn in response to: Bob Quinn
  Click to reply to this thread Reply
Problem (could) be here:
(command "change" ent "" "P" "layer" "lds" "")
.. IF you do not have a layer called 'lds' .. will fail.
So, I recommend Making that layer, before changing
ent (to) that layer.
e.g.
(if ent
(progn
(command ".layer" "M" "lds" "")
(command "change" ent "" "P" "layer" "lds" "")
); progn
(notify "in draw_top_view_balance_blocks and there is no ent")
); if
Bob
Bob Quinn
Re: Stumped on intermitant error.....
Posted: Mar 14, 2009 3:52 PM   in response to: EC-CAD in response to: EC-CAD
  Click to reply to this thread Reply


It is failing at the insert line.... at least thats
what the test points are telling me... but yes, the error looks like something
from the layer command....

 

maybe I will try to remove the layer command, and
see if the problem goes away... I have not tried that.

I don't know how the test points could be wrong
but... I have seen stranger things happen!

 

Thanks for the help....

 

 

 


<EC-CAD> wrote in message news:6142338@discussion.autodesk.com...
Problem
(could) be here: (command "change" ent "" "P" "layer" "lds" "") .. IF you do
not have a layer called 'lds' .. will fail. So, I recommend Making that layer,
before changing ent (to) that layer. e.g. (if ent (progn (command ".layer" "M"
"lds" "") (command "change" ent "" "P" "layer" "lds" "") ); progn (notify "in
draw_top_view_balance_blocks and there is no ent") ); if
Bob