Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. @devitgcode acts weird. It asks me to type distance,and when I do it places only one block and asks for distance again to pace another block, and on and on.
  3. Today
  4. This is a good video that explains lisp and how to do autocount block
  5. You may consider using this tool, which enables viewport panning with a customizable layer interface, retains coordinate memory, and functions even when the viewport is locked. I hope this helps you: https://lispautocad.gumroad.com/l/bgesj
  6. If your original drawing has saved Layer States, you can: - Open the original drawing. - Go to Layer Properties Manager → click Layer States Manager. - Export the layer state. - In the new drawing, import that layer state and apply it to the viewport. This preserves layer visibility, color, linetype...
  7. Yesterday
  8. motee-z

    strange behavior of 3dface

    where are experts of autocad no answer since five days
  9. I agree with separating the constituent parts . have broken the assembly into separate dynamic blocks so that the central trusses, roof tracking , edge beams and ridge units are separate dynamics . I have run into a few issues that I have uploaded as a new thread . ive tried running the lisp above but struggling to see how I can use this to add data to the lookup tables??
  10. I have developed the attached dynamic block which positions nested blocks according to the distance value set in a block properties table. To avoid text mirroring of the nested block labels I have used attributes and added a flip action. This all works well until I try and change the length after a flip. It appears the xpos value in the block properties table is applied as positive despite the flip state. I have tried changing the point parameters to stretch parameters but have similar problems, especially when rotating the assembly to different angles. I was hoping something as simple as adding a formulae into the block properties table ie dist*flipstate would work but there doesn't seem to be anyway to do this. Is there a way to solve this? jam3.dwg
  11. @HypnoS Find attached cpy-blk-2-poly-01.lsp
  12. Should have known.... LeeMac
  13. Not sure how to even frame the question... Given a block like this: If it is inserted and is the first instance, change the text to 01, each additional insert will be numbered based upon the total number of that particular block being inserted. Can the text be text/mtext or would it have to be an attribute? I suppose it would search the block table when it is run and number additional inserts based upon the total existing in the drawing at the time of the insert. Has anyone seen such a routing/proggie that does that? If I used diesel (or other) could the numbers update automatically if one is deleted either by regen or some other trigger? Based upon their order within the blocktable? I do not even know how to search on something like this... Since I figured something would have to be written, I asked here but other forums might know of solutions..
  14. HypnoS

    Need better multiline

    Overall, Lisp works as expected. I mainly use it to draw simple cable trays. I know that creating things like T-junctions and branches will be impossible, so I'm not even asking for that. Width range we use between 50-500mm most often 100mm and 200mm.
  15. You should first ask at that thread in your link and let the author of that code amend it.
  16. I'll look into that, I might have posted the wrong one. I was working on one to just use the block clicked assuming a single attribute.
  17. SLW210

    Need better multiline

    It seems non productive to not get a FREE program to do what you need. Maybe I'll have time later today to look at them, I have these LISPs from a while back, though I may have skipped some versions. So just to make any time spent on this worthwhile, what exactly are you looking to do and what, besides the error and select elbow from dropdown, that you mentioned? What standards do you use? What size ranges do you work with? Are you doing pipe, ducts, cable trays, etc.
  18. Lee Mac

    acet-laytrans

    Use double-backslashes.
  19. hello i have problem loading acet-laytrans from scr file. (acet-laytrans "C:\Users\Utente\Dropbox\Lavoro\backup\AUTOCAD\Template\mauro\MOD.las" [1]) The specified file could not be found.; error: ADS request error why?
  20. Steven P

    Entmake Fields

    Weirdly for this one, I didn't check Lee Mac, I usually do. I did look at Taborder, but likely that the title blocks will be updated in the near future, tab order might change so this way was a bit future proofing (fewer later changes). Thanks for LISPs, I'll take a look at them this morning
  21. HypnoS

    Need better multiline

    Currently, I have to use pure CAD at work. I can't download the MEP version. We're slowly starting to implement REVIT, but it will take time.
  22. @devitgYeh! Distance between blocks on a new straight polly. @SLW210Sorry but typing block atribute or even clicling on it seems to no work for me Enter the tag to use: ADRES ; error: bad argument type: numberp: ---
  23. Last week
  24. BIGAL

    Entmake Fields

    Have a look at Lee-mac "page X of Y" does just that for title blocks. You can make a field that uses taborder for sheet number and count for the total of layouts., I would use these in attributes of a title block where I worked it had 25 attributes. Trying to find a shorter version. Had something the COUNT did not work in Bricscad V24. Just a second comment look here for DWGINDEX.lsp does just that makes a index of your layouts based on title block Tag names. InsertSheetofSheets.lsp Dwgindex.lsp
  25. in the link below https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fillet-and-trim-just-one-entity/td-p/8885891
  26. Please use Code Tags for your code in the future. (<> in the editor toolbar) Where did you find this LISP?
  27. Hi all; I found this lisp below on the internet it works perfectly, but i have multiple lines i need to enter the radius for each line, so i was wondering if anyone can help me to let the lisp take the same fillet as regular fillet without asking each time and the lisp repeat it self untill pressing "ESC", Thanks in advance ; fillet with Radius, First keep, second trim (defun c:FCLL (/ *error* adoc oVAR nVAR getval e1 e2 entq p2 l l1 e er ss 1pt 2pt midpt ename param oblouk LayerName z1) ;******** (defun *error* (errmsg) (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end")) (princ (strcat "\nError: " errmsg))) (mapcar 'setvar nVAR oVAR) (vla-endundomark adoc) (princ)) ;;; GETVAL - returns the group value of an entity. ;;; like the wellknown (dxf) function but accepts all kinds of ;;; entity representations (ename, entget list, entsel list) (defun GETVAL (grp ele) ;"dxf value" of any ent... (cond ((= (type ele) 'ENAME) ;ENAME (cdr (assoc grp (entget ele))) ) ((not ele) nil) ;empty value ((not (listp ele)) nil) ;invalid ele ((= (type (car ele)) 'ENAME) ;entsel-list (cdr (assoc grp (entget (car ele)))) ) (T (cdr (assoc grp ele)))) ); end getval (vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object)))) (setq oVAR (mapcar 'getvar (setq nVAR '(CMDECHO TRIMMODE PEDITACCEPT OSMODE)))) (mapcar 'setvar nVAR '(1 0 1 0 )) (setvar "filletrad" (cond ((getreal (strcat "\nSpecify fillet radius <" (rtos (getvar "filletrad") 2 2) ">: "))) (T (getvar "filletrad")))) (while (and (null (setq e1 (entsel "\nSelect first object (TO BE MODIFIED): "))) (wcmatch (getval 0 e1) "LINE,ARC,LWPOLYLINE"))) ;Identify the layer of the first selected entity (setq LayerName (cdr (assoc 8 (entget (car e1))))) (redraw (car e1) 3) (while (and (null (setq e2 (entsel "\nSelect second object (REMAINS THE SAME): "))) (wcmatch (getval 0 e2) "LINE,ARC,LWPOLYLINE"))) (redraw (car e2) 3) (setq p1 (cadr e1)) (setq e1 (car e1)) (if (= (getval 0 e1) "LWPOLYLINE") ;if 1nd polyline (progn (setq l (entlast)) (command "_.EXPLODE" e1) ;make it line or arc (would be trimed) (setq ss (ssadd)) (ssadd (setq e (entnext l)) ss) (while (setq e (entnext e)) (ssadd e ss)))) (if (= (getval 0 e2) "LWPOLYLINE") ;if 2st polyline (progn (setq ename (car e2) midpt (vlax-curve-getClosestPointTo ename (trans (cadr e2) 1 0)) param (vlax-curve-getParamAtPoint ename midpt) 1pt (vlax-curve-getPointAtParam ename (fix param)) 2pt (vlax-curve-getPointAtParam ename (1+ (fix param)))) (if (> (abs (- (- (vlax-curve-getDistAtPoint ename 2pt) (vlax-curve-getDistAtPoint ename 1pt)) (distance 2pt 1pt))) 0.002) (setq oblouk T)) (if oblouk (command "_.ARC" 1pt midpt 2pt) ;make it line or arc (would be keeped) (command "_.LINE" 1pt 2pt "")) (setq l2 (cons (entlast) (list (cadr e2)))))) ;if 1st line or arc (if (wcmatch (getval 0 e2) "LINE,ARC,CIRCLE") (progn (entmake (entget (car e2))) ;duplicat it (setq l2 (cons (entlast) (list (cadr e2)))))) (setvar "trimmode" 1) (command "_.FILLET" (nentselp p1) l2) ;new arc (setq er (entlast)) (command "_.CHANGE" er "" "_P" "_LAyer" LayerName "") ; change layer (entdel (car l2)) ;trim substitude of 1st erased (if ss (command "_.PEDIT" er "_J" ss "" "" ;if 2nd was pl, recreate pl "_.ERASE" ss "")) ;the rest of it (2nd side) erase (command "_.REGEN") (*error* "end") (princ) )
  28. Steven P

    Entmake Fields

    Part 2 of my weekend homework, adding more for info. This one searches for blocks, gets the object ID for a named attribute and returns the field expression for that attribute. MyString is a default text if the required attribute isn't found in any blocks (loop stops when it finds the named attribute in a block). Example I was looking at is as my Insert blocks DCL, above, adding in a drawing border made of a few blocks one of them is a field from the drawing number - adding in the title block the object name is dynamic, this gets the code needed for that title block (defun PMField ( MyField MyString / MyBlocks Ent acount Att x tmplist) (setq MyBlocks (ssget "_X" '((0 . "INSERT")))) (setq acount 0) (while (and (equal tmplist nil) (< acount (sslength MyBlocks))) (setq Ent (ssname MyBlocks acount)) (foreach Att (vlax-invoke (vlax-ename->vla-object Ent) 'GetAttributes ) ;_ end of vlax-invoke (if (= (strcase (vla-get-TagString Att)) MyField) (setq tmpList (cons Att (vla-get-TextString Att))) ) ; end if ) ; end foreach (setq acount (+ acount 1)) ) ; end while (if (equal tmplist nil) (progn (princ (strcat "No block with attribute '" MyField "' found")) ;; (setq MyString "OFFICIAL") ) (progn (setq x (car tmplist)) (setq MyString (strcat "%<\\AcObjProp Object(%<\\_ObjId "(itoa (vla-get-objectid x))">%).TextString>%")) ) ; end progn ) ; end if MyString )
  29. Steven P

    Entmake Fields

    Coming back to this one again... I came on this solution, weekend testing and it works so far. Just needs the vla-put-textstring to update the text to a field. Not checked yet if it will do a nice mix of text and field - should do. Also noted that can entmake text with a field embedded into a block - doesn't need that extra line, when block is inserted it does its stuff (example, attributes for drawing number and drawing number repeated at the top left corner as a field.. see next comment) (setq MyString -String including field codes- ) (setq MTextObj (vlax-ename->vla-object (entmakex (list '(0 . "MTEXT") '(100 . "AcDbEntity") '(67 . 0) '(8 . "0") '(100 . "AcDbMText") '(10 0.0 0.0 0.0) '(40 . 2.5) '(41 . 0.0) '(46 . 0.0) '(71 . 1) '(72 . 5) (cons 1 MyString) '(7 . "Standard") '(11 1.0 0.0 0.0) '(42 . 15.4246) '(43 . 2.58697) '(50 . 0.0) '(73 . 1) '(44 . 1.0) )) ; end entmakex ; end list )) ; end vlax-ename ; end setq (vla-put-textstring MTextObj MyString) ;; update field.
  1. Load more activity
×
×
  • Create New...