Jump to content

Leaderboard

Popular Content

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

  1. would this help? https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/remove-blocks-in-locked-layers/td-p/3514608
    1 point
  2. Coming back to this quickly, if the OP has a 'U' shaped polyline, with 2 or more filleted corners just selecting the polyline isn't going give the required apex ? I read the question wrong last night and what I posted above isn't quite what is needed, I'll look at this later
    1 point
  3. Agreed. Not sure why anyone in this day and age would not use paperspace .. unless still using a 3rd party app created in the mid 80's. Even then you could create layouts to print.
    1 point
  4. (setvar 'osmode 16384) is all off, but most times I use 0
    1 point
  5. The Model v's paperspace debate
    1 point
  6. My attempt. (defun c:Apex ( / sel pts pt1 pt2 pt3 pt4 pt5 pt6 sg1 sg2) ;; Tharwat - 5.Mar.2022 ;; (and (princ "\nSelect LWpolyline : ") (setq sel (ssget "_+.:S:E" '((0 . "LWPOLYLINE")))) (mapcar '(lambda (q) (and (= (car q) 10) (setq pts (cons (cdr q) pts)))) (reverse (entget (ssname sel 0)))) (or (< 5 (length pts)) (alert "Polyline should have at least 6 vertices to continue <!>") ) (mapcar 'set '(pt1 pt2 pt3 pt4 pt5 pt6) pts) (setq sg1 (distance pt1 (inters pt1 pt2 pt4 pt3 nil)) g2 (+ (distance pt1 pt2) (distance pt3 (inters pt3 pt4 pt6 pt5 nil))) ) ) (list sg1 sg2) )
    1 point
  7. Rather then doing stupid math why not just make a copy then fillet with radius 0. (setq poly (vlax-invoke (vlax-ename->vla-object ent) 'copy)) (setvar 'filletrad 0) (vl-cmdf "_.Fillet" "P" (entlast)) Then its just 1+2 & 1+2+3 --EDIT Then delete poly when done
    1 point
  8. No problems. Who seeks will always find.
    1 point
  9. I dont run compiled code that I don't know where it came from. Its unlikely but it could have malicious code in there.
    1 point
  10. What is it doing? The setting itself can be changed with LISP, etc.
    1 point
  11. Ah sorry didn't see that. Another tip for osmode. You can add non right before the point and it wont snap to anything. Like the temp override snap when you shift right click. Don't ask me why/how but even with osmode set to 0 if your zoomed out enough and using command with points. stuff will still snap to entity's so its always good to use "_non". This is one of the reasons why I try to limit the use of command. Its also good to wrap selections with if. because if the user doesn't select anything no point in running the rest of the code and it could error also. ; error : bad argument type <NIL> ; expected SELECTIONSET at [sslength] (if (setq ss (ssget '((0 . "TEXT,INSERT") (8 . "CAO DO")))) ; only need to use cons when using variables (repeat (setq x (sslength ss)) (setq ent (ssname ss (setq x (- x 1)))) (cond ;like if but better see below ((eq (setq itm (cdr (assoc 0 (setq txt (entget ent))))) "TEXT") ;setq txt so you dont need to run entget 4 other times (setq ins (cdr (assoc 11 txt))) ;this depends on the text justification see below (setq val (cdr (assoc 1 txt))) (setq pnt (list (car ins) (cadr ins) (atof val))) (command "-INSERT" "donut" "_non" pnt 0.0002 0.0002 0) (entmod (subst (cons 10 pnt) (assoc 10 txt) txt)) ;use pnt aswell ) ((eq "INSERT" itm) (entdel ent) ) ) ) (prompt "\nNothing Selected") ) Check to see if right insertion point is used (if (eq (cdr (assoc 10 txt)) '(0.0 0.0 0.0)) (setq ins (cdr (assoc 11 txt))) (setq ins (cdr (assoc 10 txt))) ) Cond Guide Self taught here as well. just keep at it and stuff will start to make more and more sense. From what I have seen your way ahead of me when I started out.
    1 point
×
×
  • Create New...