New to LISP - trying to debug someone elses code

New to LISP - trying to debug someone elses code

ksd
Participant Participant
450 Views
2 Replies
Message 1 of 3

New to LISP - trying to debug someone elses code

ksd
Participant
Participant

Hi,

 

I'm trying to figure out why our lisp is failing, I have coding experience, but next to no experience with lisp..

 

I've narrowed it down to this line:

 

(setq sset1 (ssget "C" (polar pt21 (* pi 0.25) 0.05) (polar pt11 (* pi 1.25) 0.05) (list (cons 0 "insert")(cons 2 "VPL_Frame_*"))));;; select current and adjoining frames

 

 

I understand this is creating a selecection set, based on the points in the ssget, but what does the last bit do? (list (cons 0 "insert")(cons 2 "VPL_Frame_*"))

 

The code loops through selecting the frames we place in drawings, but the code regularly falls over on a partivular frame at this line, I have no idea what makes it stop on a particular frame, when the frames beforehand work fine...

 

Hopefully someone can shed some light on what the code is doing to point me in the answers direction.

 

Cheers,

Kyle.

0 Likes
451 Views
2 Replies
Replies (2)
Message 2 of 3

hmsilva
Mentor
Mentor

@Anonymous wrote:

Hi,

 

I'm trying to figure out why our lisp is failing, I have coding experience, but next to no experience with lisp..

 

I've narrowed it down to this line:

 

(setq sset1 (ssget "C" (polar pt21 (* pi 0.25) 0.05) (polar pt11 (* pi 1.25) 0.05) (list (cons 0 "insert")(cons 2 "VPL_Frame_*"))));;; select current and adjoining frames

 

 

I understand this is creating a selecection set, based on the points in the ssget, but what does the last bit do? (list (cons 0 "insert")(cons 2 "VPL_Frame_*"))

 

The code loops through selecting the frames we place in drawings, but the code regularly falls over on a partivular frame at this line, I have no idea what makes it stop on a particular frame, when the frames beforehand work fine...

 

Hopefully someone can shed some light on what the code is doing to point me in the answers direction.

 

Cheers,

Kyle.


Hello Kyle and welcome to the Autodesk Community!

 

The last bit is a filter list to the ssget function,

DXF 0 is the object TYPE = INSERT

DXF 2 is the name = VPL_Frame_*

 

but you are using the Crossing selection mode, and we need to ensure that objects are visible during the selection, try to add a zoom with those points, do the selection, zoom previous.

 

Hope this helps,
Henrique

 

EESignature

0 Likes
Message 3 of 3

Satoews
Advocate
Advocate

http://www.afralisp.net/reference/dxf-group-codes.php

 

AND 

 

(defun c:fed ()
  (IF
    (setq ll1 (entsel "\nPlease select an object for entity data:"))
	  (setq entdata (entget (car ll1)))
	  
	  (progn
        (prompt "\nNo entity found.")
	    (princ)
	)  
  )
)

 

This will help in the future if your trying to figure out other dxf codes. The lisp is to grab data from a single entity. 

Shawn T
0 Likes