Jump to content

Recommended Posts

Posted

Hi

 

when i set breakpoint and the intepeter meets lamda i get a new window :

 

;;; Copied to window at 4:56 PM 6/21/13

(LAMBDA (E) (= (CAR E) 10))

;;; End of text

 

and i cant go on with my test

 

why its like that and how to overcome?

 

Thanks

Shay

Posted

I'll second that. I just started using lambda for the first time in one of my projects and while debugging I got the same thing, but the message was related to the syntax in my lambda statement, not the same as yours. But this window came up and I could not continue stepping through the program. I removed the offending lambda line and replaced it with my original (if (or (=.... syntax and things returned to normal.

Posted

i find that if i hit continue its return the focus to the editor and you can go on

continue.jpg

Posted

FWIW -

(vlax-get <vlaObj> 'coordinates)

Posted

no it didnt work

 

i have this code

(defun C:DEMO (/ pl pts sspl tpts i ptlist)
   (if    (setq sspl (ssget '((0 . "LWPOLYLINE"))))
   (progn
       (setq i 0)
       (while (< i (sslength sspl))
       (setq pts (mapcar 'cdr
                 (vl-remove-if-not
                     '(lambda (e) (= (Car e) 10))
                     (entget (ssname sspl i))
                 )
             )
       )
       (setq i (1+ i))
       (setq tpts (cons pts tpts)) 

       )
   )
   )
   (setq tpts (apply 'append tpts))
   (setq ln (findPairs (nth 0 tpts) tpts 58))
;;;    (command "LINE" (nth 0 ln) (nth 1 ln) )
)


(defun findPairs(fxp lst d / i p tot col )

(setq i 0)
(while (< i (length lst))
   (setq col
        (vl-remove-if-not
        '(lambda (e)
             (and (not (equal fxp e)) (> d (getdist (fxp e)))))lst))
   (setq i (1+ i))
   (setq tot (cons col tot))
)
   tot
)

it yells an error, when i set a break point and i get to lambda it opens a new window and than finishing the proccess

 

any idea how to overcome it?

 

Thanks

Shay

Posted

Unless I've misunderstood what you're after... Give this a try:

(vl-load-com)

(defun c:CopyBreak (/ *error* acDoc)

 (defun *error* (msg)
   (if acDoc
     (vla-endundomark acDoc)
   )
   (cond ((not msg))                                                   ; Normal exit
         ((member msg '("Function cancelled" "quit / exit abort")))    ; <esc> or (quit)
         ((princ (strcat "\n** Error: " msg " ** ")))                  ; Fatal error, display it
   )
   (princ)
 )

 (if (and (ssget '((0 . "LWPOLYLINE")))
          (princ "\nWorking, please wait... ")
          (princ)
     )
   (progn
     (vla-startundomark
       (setq acDoc (vla-get-activedocument (vlax-get-acad-object)))
     )
     (vlax-for x (vla-get-activeselectionset acDoc)
       (vla-explode (vla-copy x))
     )
   )
 )
 (*error* nil)
)

Posted

i dont understand BlackBox

 

how this code is gonna help me? i just need to paste it as a part of my code?

Posted
i dont understand BlackBox

 

how this code is gonna help me? i just need to paste it as a part of my code?

 

I think you should be thankful other than shouting and being angry , and you should keep in mind that all users here are helping the others due to their high sense of kindness and generosity and the Black Box is one of the best of them .

Posted
I think you should be thankful other than shouting and being angry , and you should keep in mind that all users here are helping the others due to their high sense of kindness and generosity and the Black Box is one of the best of them .

 

what wrong with you Tharwat ? im more than happy to find those pepole (including you) . there are all extra kind and willing to help. how did you got to this idea anyway?

Posted

BlackBox..i still dont know how to use it :?

Tharwat...instead of shouting on me why not trying to help nice Jewish boy :lol:

Posted
I think you should be thankful other than shouting and being angry , and you should keep in mind that all users here are helping the others due to their high sense of kindness and generosity and the Black Box is one of the best of them .

 

That is kind of you to say, Tharwat... It means a great deal to me, to have made such an impression. Thank you.

 

I'm starting to suspect that there may be a language issue, both English, and LISP, as the OP seems to lack in understanding of how to even used code others offer to try and help, despite needing help with code.

 

I can absolutely appreciate what you're trying to convey here, but given the possibility of a language issue, I'm inclined to be a bit more lenient at this time... Hopefully that is understood by the OP, and clearer, more precise, and complete responses from them are forthcoming.

Posted
BlackBox..i still dont know how to use it :?

 

Sorry for any confusion; sice you're asking for help with LISP, I assumed you knew how to load the code.

 

As a quick test, you can copy and paste the code I posted to your command line... To invoke, use the CopyBreak command.

 

The code creates a duplicate copy of the Polyline selected, and explodes it ito it's line and at segments... Which is what I suspected you were attempting to do based on the code you posted previously.

 

If this is not what you're after, please post a clearly written, complete statement of what it is you are after, so that we may be able to help you.

Posted

Hi

 

I think this thread is a misunderstanding of my request and my tempure. As you said no one should forget we came from all over the word. in my culture white is color of happiness while in china white symbolize grief.

 

Im not appreciate as much as you did what he tried to do,he just stain my name in order to show his kindness and appreciation, hopefully people here are intelligent enough to understand.

 

Regarding my post, I didn’t post the code to try solve aproblem but to demonstrate what code was evaluated while lambda creates a newwindow. You can ignore the code and sorry to mislead you.

 

My knowledge in LISP got much better thanks to all of you!

 

So the problem is that when setting breakpoints , I followafter each statement but when the interpreter get to lambda a new window appearand im stuck, the sassion stops.

 

That why I asked how the code can help me because I didn’t seethere anything relevant to my problem

 

Shay

Posted

I think this thread is a misunderstanding...

 

Im not appreciate as much as you did what he tried to do,he just stain my name ...

 

Nobody has stained your name... Moving forward, let's focus like a laser beam on the issue you're having with Lambda, and stop perpetuating continued, mutual misunderstanding.

 

Regarding my post, I didn’t post the code to try solve aproblem but to demonstrate what code was evaluated while lambda creates a newwindow. You can ignore the code and sorry to mislead you.

 

...

 

So the problem is that when setting breakpoints , I followafter each statement but when the interpreter get to lambda a new window appearand im stuck, the sassion stops.

 

That why I asked how the code can help me because I didn’t seethere anything relevant to my problem

 

My apologies for the confusion on my part... I understand you're attempting to understand what's going on with Lambda, and my code was intended to demonstrate that the Lambda in your code is unnecessary to begin with.

 

However, you're correct, even if my code does what you're after, it does not answer the question of why you're experiencing the behavior regarding Lambda in VLIDE.

Posted
... the question of why you're experiencing the behavior regarding Lambda in VLIDE.

 

I suspect this is due Lambda being an anonymous function.

Posted

I already use alternative becuse of the debugging berrier, but I can see how much of code one lambda is saving you. But can't afford coding without debugging

  • 4 weeks later...
Posted

My good coders. I waste lots of time writing code that could be solved by lambda and map car. I'm sure the gurus here knows how to debug code that contain lambda and mapcar please share it with us

 

Thanks

Shay

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...