Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/03/2022 in all areas

  1. Something like this, but notes its based on how the square was drawn, if you want top left and bottom right that is your home work there are a few methods to check the X&Y points. (defun c:wow ( / plent ) (setq plent (entsel "\nPick rectang")) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent))))) (command "Point" (nth 0 co-ord)) (command "Point" (nth 2 co-ord)) (princ) ) (c:wow) Another method is to use "Bounding box" it returns the opposite corners to what you want, but can work out the other corners by pulling the X & Y values of the min and max. (setq obj (vlax-ename->vla-object (car (entsel "pick object ")))) (vla-GetBoundingBox obj 'minpoint 'maxpoint) (setq pointmin (vlax-safearray->list minpoint)) (setq pointmax (vlax-safearray->list maxpoint)) ;minpoint contains the minimum point of the bounding box ;maxpoint contains the maximum point of the bounding box
    2 points
  2. (defun stsup ( l ) (if l (cons (list (car l) (cadr l)) (stsup (cddr l))))) (defun c:testcoord (/ obj_poli coordenadas lista_pt lista_pt1) (while (setq obj_poli (vlax-ename->vla-object (car(entsel "\nSelecciona polilinea: ")))) (setq coordenadas (vla-get-coordinates obj_poli)) (setq lista_pt (stsup (vlax-safearray->list (vlax-variant-value coordenadas)))) ;ordenamos lista de menor a mayor X, y si son iguales, de menor a mayor Y (setq lista_pt1 (vl-sort lista_pt '(lambda (el1 el2) (if (equal (car el1) (car el2)) (> (cadr el1) (cadr el2)) (< (car el1) (car el2)) ) ))) (entmake (list '(0 . "POINT")'(100 . "AcDbEntity")'(100 . "AcDbPoint")(cons 10 (car lista_pt1)))) (entmake (list '(0 . "POINT")'(100 . "AcDbEntity")'(100 . "AcDbPoint")(cons 10 (last lista_pt1)))) (princ "\nPunto 1: ") (princ (car lista_pt1)) (princ " Punto 2: ") (princ (last lista_pt1)) (princ) );fin While )
    1 point
  3. (defun stsup ( l ) (if l (cons (list (car l) (cadr l)) (stsup (cddr l)))));by ???? (defun c:testcoord () (setq obj_poli (vlax-ename->vla-object (car(entsel "\nSelecciona polilinea: ")))) (setq coordenadas (vla-get-coordinates obj_poli)) (setq lista_pt (stsup (vlax-safearray->list (vlax-variant-value coordenadas)))) ;ordenamos lista de menor a mayor X, y si son iguales, de menor a mayor Y (setq lista_pt1 (vl-sort lista_pt '(lambda (el1 el2) (if (equal (car el1) (car el2)) (> (cadr el1) (cadr el2)) (< (car el1) (car el2)) ) ))) (princ "\nPunto 1: ") (princ (car lista_pt1)) (princ " Punto 2: ") (princ (last lista_pt1)) (princ) )
    1 point
  4. Hi Steve P, it seems to me that \ t was what I was missing to get me to the solution of the problem! For Bigal: I do not know the lisp that you have reported to me and I will look for it in the discussions of the forum, I will see what it is, thanks for the report
    1 point
  5. I use Design Center as well. Very quick and easy, IMO.
    1 point
  6. Tombu you would like this, 100's of signs at your fingertips and its a TTF. So can use in say Word and Excel also. Now the bad news I can not find the company that made them "AUS Fonts" if you find them let me know.
    1 point
  7. Yes, that's entirely possible. Open a drawing, hit F2, and look at what commands have been run before you do anything else. That should clue you in.
    1 point
  8. helps if you give all the information to start with..... By default the 'last command' in AutoCAD when you open a drawing is Help - try it, open something and press enter - help opens. Do another command and enter will repeat the 'last command', I guess they needed to put something there. Is that snippet all that is in your file? might be something else in there affecting things
    1 point
  9. Pasting your code in my command line executed perfectly! In acaddoc.lsp you would only need the line (command "_purge" "A" "*" "N") Did you put the code in acaddoc.lsp or in the startup suite?
    1 point
  10. Need more information, did you put the code in acaddoc.lsp or in the startup suite? Seeing what code you added is the only way to really debug what happened.
    1 point
  11. I love both the way you automatically summon him as the keeper of this answer AND the fact that he beat you to it. He's like the CAD genie.
    1 point
  12. It turns all of them off if that's what you want, but Lee Mac's first post "A nice example from CAB:" toggles the osnaps on & off. You can also do this by clicking the "2D Object Snap" icon on the Status Bar or using either F3 or Ctrl+F. Welcome to our Forums!
    1 point
  13. Why not D1 D2 much easier. You can make as many little lisp defuns as you need, just load on start up say a lisp with all your short cuts. Just check that say d1 is not a command. You can use numbers if you want, I use 47 for setting my osnaps that I like. (defun c:d1 ( / ) (command "._-dimstyle" "_restore" "Dstyle1") ) (defun c:d2 ( / ) (command "._-dimstyle" "_restore" "Dstyle2") )
    1 point
×
×
  • Create New...