Jump to content

Leaderboard

Popular Content

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

  1. Give this a try: (defun c:foo (/ c n s) (cond ((and (or (setq n (getdist "\nEnter area value to check:<300> ")) (setq n 300)) (setq c (acad_truecolordlg 1)) (setq s (ssget '((0 . "LWPOLYLINE") (8 . "living")))) ) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (if (>= (vlax-curve-getarea e) n) (entmod (append (entget e) c)) (ssdel e s) ) ) (sssetfirst nil s) ) ) (princ) )
    2 points
  2. What are you my 7th grade math teacher asking me to show my work?! lightly tested seems to work. use at your own risk. TextCalcV1-01.lsp
    2 points
  3. just fyi Ron your code ask for an area but then only uses 300 to check instead of n. (if (>= (vlax-curve-getarea e) 300.)
    1 point
  4. Try this change adding new line asking for area value and changing line 4 in full code. (defun C:PolyArea (/ SS ent poly minarea) (setq minarea (getreal "\nEnter area to check for ")) (if (setq SS (ssget "_X" '((0 . "*POLYLINE") (8 . "LIVING") (410 . "Model")))) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (if (>= (vlax-get (vlax-ename->vla-object ent) 'Area) minarea) ;(>= (vlax-curve-getarea e) 300.) is better .............
    1 point
  5. Perfect @pkenewell, thanks a lot. Here's the working version. I don't know if I remember if there was a vla-get to get items that can be hatched. But for now this brute force method works. (vl-load-com) ; Tharwat 18th Sept 2013 ; Modified on 2022.12.12 by 3dwannab to hatch everything inside the block. Help over here: https://www.cadtutor.net/forum/topic/76450-hatch-objects-inside-a-block/ ;; TO DO: Only hatch entities that can be hatched. Think there may be a vla-get for this. Not sure. ; https://www.cadtutor.net/forum/topic/46782-deleting-hatch-from-blocks/?do=findComment&comment=396412 (defun c:BKHatchAll_Solid (/ *error* acDoc blkn cnt ss1 var_cmdecho var_osmode) (defun *error* (errmsg) (and acDoc (vla-EndUndoMark acDoc)) (and errmsg (not (wcmatch (strcase errmsg) "*CANCEL*,*EXIT*")) (princ (strcat "\n<< Error: " errmsg " >>\n")) ) (setvar 'cmdecho var_cmdecho) (setvar 'osmode var_osmode) ) (setq acDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (or (vla-EndUndoMark acDoc) (vla-StartUndoMark acDoc)) (setq var_cmdecho (getvar "cmdecho")) (setq var_osmode (getvar "osmode")) (setvar 'cmdecho 0) (setvar 'osmode 0) (prompt "\nSelect blocks to hatch with solid hatch: ") (if (setq ss1 (ssget '((0 . "INSERT")))) (progn (setq cnt 0) (repeat (setq cnt (sslength ss1)) (setq cnt (1- cnt) blkn (cons (vla-get-effectivename (vlax-ename->vla-object (_dxf -1 (entget (ssname ss1 cnt))))) blkn) ) ) (setq blkn (_removedup blkn)) (foreach x blkn (command "-bedit" x) (command "_.-hatch" "_P" "_S" "_LA" "." "_advanced" "_associativity" "_yes" "" "_select" "_all" "" "") (command "_.bsave") (command "_.bclose") (redraw) ) (setvar 'cmdecho var_cmdecho) ) ) (*error* nil) (princ) ) ;; removes duplicate element from the list (defun _removedup (l) (if l (cons (car l) (_removedup (vl-remove (car l) (cdr l)))) ) ) ;;----------------------------------------------------------------------;; ;; _dxf ;; Finds the association pair, strips 1st element ;; args - dxfcode elist ;; Example - (_dxf -1 (entget (ssname (ssget) 0))) ;; Returns - <Entity name: xxxxxxxxxxx> (defun _dxf (code elist) (cdr (assoc code elist)) ) ; (c:BKHatchAll_Solid)
    1 point
  6. Yup. That hatch command is a strange one how it works on its own.
    1 point
  7. Easy quick lisp (defun c:a12 (/ l r u ip) (setq l 24.0 r 32.87 ip (getpoint "\n Pick arc center point: ") u (/ l r) ) (entmake (list (cons 0 "ARC") (cons 10 ip) (cons 40 r) (cons 50 0) (cons 51 u) )) (princ) )
    1 point
  8. For me it would be quicker to draw the circle with radius 32.87, break the circle and then use Lengthen to get to the arc length of 24.
    1 point
×
×
  • Create New...