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

Points within a wall

1 REPLY 1
SOLVED
Reply
Message 1 of 2
stelios16
222 Views, 1 Reply

Points within a wall

Hello again!

New function, new problem 😉

 

(defun c:pts_autour_voile ()


    (setq accrochage (getvar "OSMODE"))
    (setvar "OSMODE" 0)
            
            (setq contour_polyligne(car(entsel "\nSelect a polyline :")))
                (if (= contour_polyligne nil)
                    (princ "\nYou havent selected anything")
                    (progn
                        (setq defpolyligne (ENTGET contour_polyligne))
                        (setq ent_polyligne ( cdr (ASSOC 8 defpolyligne)))
                            (if (= ent_polyligne "Polyligne_Concrete")
                                (progn
                                    (foreach rec defpolyligne


                                        (if (= (car rec) 10)
                                            (progn
                                                (setq points (append  points (list (cdr rec))))
                                                (setq Xpoints (append Xpoints (list (cadr rec))))
                                                (setq Ypoints (append Ypoints (list (caddr rec))))
                                            );fprogn
                                        ) ;endif
                                    ) ;endforeach
                                    (setq x (+ (apply 'max Xpoints) 1))
                                    (setq y (+ (apply 'max Ypoints) 1))   
                                    (setq pointmax (list X Y)) 
                                    (print x)
                                    (print y)
                                    (command "decaler" "0.1" contour_polyligne pointmax "") 
                                    
                                    (setq contour_polyligne2 (entlast))
                                    (setq defpolyligne2 (ENTGET contour_polyligne2))
                                    (setq ent_polyligne2 ( cdr (ASSOC 8 defpolyligne)))
                                        (if (= ent_polyligne2 "Polyligne_Concrete")
                                            (progn
                                                (foreach rec2 defpolyligne2
                                                    (if (= (car rec2) 10)
                                                        (progn
                                                            (setq points2 (append points2(list (cdr rec2))))
                                                            (setq points_autour (ssget "_CP" points2))
                                                                (print points_autour)
                                                        );progn
                                                    );endif
                                                );foreach
                                            );progn
                                        );endif
                                ) ;fprogn
                                (princ "\nyou havent selected a polyline")
                            ) ;endif
                    ) ;fprogn
                ) ;endif

 (princ)
 
 (setvar "OSMODE" accrochage)
)

 

 

Why is 'points_autour'  empty ??? 😞

 

1 REPLY 1
Message 2 of 2
Kent1Cooper
in reply to: stelios16


@stelios16 wrote:

....

                                    (command "decaler" "0.1" contour_polyligne pointmax "") 
                                    
                                    (setq contour_polyligne2 (entlast))
....


I don't know what the English equivalent command name for "decaler" is, but [judging from an on-line French-English dictionary] if it's Scale or Move, then:

 

1.  If it's Scale, it looks like the answers to the command prompts are in the wrong order; if it's Move, the same is true and the 0.1 isn't enough to specify where to move it.

 

2.  The Polyline scaled or moved won't necessarily be (entlast).  If that's the problem, whatever (entlast) really is may have something that can be put into the point2 variable, but probably not anything relevant to the routine, and maybe [if it's something like a Line or Text or a Block] only one point, which doesn't make a good crossing polygon for selection.

 

If "decaler" is Copy, there would be a new object that would be (entlast), but it would have the same command-prompt-answer problems as with Move.

Kent Cooper, AIA

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

Post to forums  

Autodesk Design & Make Report

”Boost