Jump to content

Leaderboard

Popular Content

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

  1. You need to add + 4 to each number ? If so, that's very easy... Retrieve attributes and just use : (vla-put-textstring (vlax-ename->vla-object attrib-ename) (itoa (+ 4 (atoi (vla-get-textstring (vlax-ename->vla-object attrib-ename))))))
    1 point
  2. Am I missing something here, what is wrong with using a selection set, something like: (defun c:hh ( / ) (setq MySS (ssget '((-4 . "<OR") (0 . "LWPOLYLINE") (0 . "*TEXT") (-4 . "OR>"))) ) (Command "-HATCH" "S" MySS "" "") ) You could add to this looping through the selection set to remove any polyline that is not a closed polyline (internet search gave me this snippet which could be used for that https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/check-to-see-if-polyline-is-closed/td-p/859164 ) (and just to note a 'simple Lisp' is often the most complex, which makes it simple for the user, can add in checks that a polyline is closed.... the LISP gets better but not so simple)
    1 point
  3. Version 1.0.0

    2,536 downloads

    This is a program made by ASMI and modified by Ronso in this thread. This is a genius free LISP Program and can be used in many trades, but has most usefulness in the HVAC, Mechanical, and Piping industries for drawing 2D CAD designs. It allows you to create Duct, Pipe, and Segmented Duct or Piping with automatic elbow or fittings to accurate dimensions via some initial input at the command prompt. The programme in action Function Syntax: DUCT For instructions on how to run the program see here.
    1 point
  4. Not to take away from Buzzard's program as it is very exquisite, here's another alternative as well for vanilla 2D CAD found here: http://www.cadtutor.net/forum/showthread.php?30545-*FREE*-HVAC-or-Piping-program-for-AutoCAD
    1 point
  5. Haha Buzzard, you have too much time on your hands
    1 point
  6. Lee Mac saving the world one lisp at a time!
    1 point
  7. Hello again to all, I have attached a lisp program that some may find useful. It is my concept of a Dimension Style Manager. I started to put this program together about a year ago, And have continued to work on it since. It works well considering it does not have every feature you would find in AutoCAD's manager, But it was setup to suit my needs so that I could get dimstyles on the fly. The program is well annotated so that you may understand how it works. What make it so good is the idea to program your own defaults into it, So all you would really need to do is select a Dimension Unit & click OK. I put the other settings in for the sole purpose of having some flexiblity for those times when you need to change something for a special project. Give it a try. Instructions are included in the program header with a function map. Enjoy! The Buzzard DSM.zip
    1 point
  8. This is a program made by ASMI and modified by Ronso in This Thread. This is a genius free LISP Program can be used in many trades, but has most usefulness in the HVAC, Mechanical, and Piping industry of 2D CAD Designs. It allows you to create Duct, Pipe, and Segmented Duct or Piping with automatic elbow or fittings to accurate dimensions via some initial input at the Command Prompt. Attached is a screenshot of the program in action: DUCT.LSP
    1 point
  9. It seems good idea to me has come. It is possible to transform existing polylines to pipes. (defun c:plp(/ lSet plLst pl pl1 pl2 oldOsm actDoc vLst1 vLst2 stLst *error*) (vl-load-com) (defun GetPlineVer(plObj) (mapcar 'cdr (vl-remove-if-not '(lambda(x)(=(car x)10)) (entget plObj))) ); end of GetPLineVer (defun asmi-LayersUnlock(/ restLst) (setq restLst '()) (vlax-for lay (vla-get-Layers (vla-get-ActiveDocument (vlax-get-acad-object))) (setq restLst (append restLst (list (list lay (vla-get-Lock lay) (vla-get-Freeze lay) ); end list ); end list ); end append ); end setq (vla-put-Lock lay :vlax-false) (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-Freeze(list lay :vlax-false))) t) ); end vlax-for restLst ); end of asmi-LayersUnlock (defun asmi-LayersStateRestore(StateList) (foreach lay StateList (vla-put-Lock(car lay)(cadr lay)) (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-put-Freeze(list(car lay)(nth 2 lay)))) t) ); end foreach (princ) ); end of asmi-LayersStateRestore (if(not duct:pWd)(setq duct:pWd 1.0)) (setq oldWd duct:pWd duct:pWd(getdist (strcat "\nSpecify pipes diameter <" (rtos duct:pWd) ">: ")) ); end setq (if(null duct:pWd)(setq duct:pWd oldWd)) (princ "\n>>> Select polylines <<< ") (if (setq lSet (ssget '((0 . "LWPOLYLINE")))) (progn (setq stLst(asmi-LayersUnlock) plLst(mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr(ssnamex lSet)))) ); end setq (vla-StartUndoMark (setq actDoc (vla-get-ActiveDocument (vlax-get-acad-object)))) (foreach pl plLst (command "_.fillet" "_r" duct:pWd) (command "_.fillet" "_p" (vlax-vla-object->ename pl)) (setq pl1(car(vlax-safearray->list (vlax-variant-value (vla-Offset pl (/ duct:pWd 2))))) pl2(car(vlax-safearray->list (vlax-variant-value (vla-Offset pl (-(/ duct:pWd 2)))))) vLst1(GetPlineVer (vlax-vla-object->ename pl1)) vLst2(GetPlineVer (vlax-vla-object->ename pl2)) ); end setq (vla-put-ConstantWidth pl1 0.0) (vla-put-ConstantWidth pl2 0.0) (vla-Delete pl) (foreach itm vLst1 (setq oldOsm(getvar "OSMODE")) (setvar "OSMODE" 0) (command "._line" itm (car vLst2) "") (setvar "OSMODE" oldOsm) (setq vLst2(cdr vLst2)) ); end foreach (asmi-LayersStateRestore stLst) ); end foreach (vla-EndUndoMark actDoc) ); end progn ); end if (princ) ); end of c:plp
    1 point
×
×
  • Create New...