Jump to content

All Activity

This stream auto-updates

  1. Today
  2. Hi All, just wanted to thank everyone again for helping me so far in my lisp journey! As a token, I worked on a VS Code extension for AutoCAD snippets. This so it can allow users to type in quickly common functions the use all the time (e.g. search layer if dont exist create layer and so on). So far I have added the comment section. Happy to receive feedback and suggestions. Thank you https://marketplace.visualstudio.com/items?itemName=CivilTechSource.autocad-lisp-snippets
  3. Yesterday
  4. There is no problem in drawing that type of break it just involves a custom lisp to break the lines and draw wiggly lines, the amount of wiggle may have a couple of FUZZY values or scale factors. even a block just scaled to fit. To write your own lisp and its a good task to start learning, Draw a line say 1 unit long vertically one end at 0,0, the turn off snap and draw a wiggly Pline. Use list select pline and copy out the co-ords, to notepad You have 1/2 your code now, just make the points, use a scale factor on the Y value to adjust the points for the 2-3/8 then can draw the pline at correct position. Ok now the easy answer make a block and again draw a line, do the pline, erase the dummy line, save block. you can insert the block and scale it to suit the length required. insert block twice, after breaking line. I would turn second insert upside down so looks a bit more random. Ok I have avoided line work on any other angle than horizontal, on purpose, you can pick a point on 1st line break it, then perp to other line and auto break it also. This involves getting linework details like angle of lines. The actual pline could have randomness added to it so no 2 plines are quite the same by in example vertical, adjusting the x value within a range so 2 breaks don't touch. So have a go make a block and your homework is in lisp, Getpoint pt1, Polar for 2nd point, based on horizontal line, then Break using 2 points, getpoint again Pt2 using perp , break other side. Simple block answer.
  5. BIGAL

    Create lisp for slab rebar

    Yes is the answer to a lisp but it will cost you, but you will get much more than just what you have asked for as I have different lisps for Concrete slab design. More than is shown in this toolbar. Two solutions needed, it is not that hard to do a dimension using correct style turn off all the extensions etc and you will have a double arrow dimension, 1st step. Don't really need code. Pick 1st point then use perp for second point and over ride dimension with "A7" etc. Can do a mini defun in lisp if needed. You should be using a dwt "drawing template" for your work so the Dim style would be there already. Second step is a line with donuts at intersection, you use (SSGET "F" pts (list (cons 8 "REOBARLAYER")))) where pts is (list pt1 pt2) you can then draw a dummy line and use the vl Intersectwith method to find the intersecting points and draw donuts. That is your homework plenty of examples about SSGET and Intersectwith.
  6. Artem

    Segments of polylines

    Hi, first of all thanks a lot, i am only beginner in my LISP journey, and for me its hard to find good info in my native lang, so any usefull help is excelent. About UCS it worked fine, lw_orth now creates line in any UCS. (command "_,ucs" "_w") and (command "_.ucs" "_p") worked out! About regular_draw i tried to implement stuff you descriibed in post, but after that console says next: I setted SNAPUNIT to 1.0,1.0 as you said. Could you help me where am i wrong in adjusting regular_draw comand, it seems what i was looking for
  7. Found this little gem, I guess perpetual license means F - Off, buy our subscription
  8. I went through the links thoroughly, thk you for that. Its not allowing me to install
  9. Many thanks.
  10. Being as it is an older non-supported version, your options are limited. There was a lot in those 2 links, what did not work?
  11. I WBlocked them. new Lines and arcs.dwg new font.dwg
  12. Hi Team, I wish to create a Lisp code for slab rebar detail that has the following conditions, Legend = The perimeter green line represents the edge line of the slab, the yellow dashed line represents the internal beam where the slab is continuous. Clouded with orange colour is the slab rebar. Clouded with purple colour is the arrangement of slab rebar in that direction. Condition 1 = User to point 6 locations to create the slab rebar length. The starting point of the rebar will be the location at last 33.33% or one-thirds length of the 1st and 2nd location. It applied the similar for 3rd and 4th location which to determine the end point for the rebar length, as shown in item 3 in the picture. Subsequently, to point 5th and 6th location to create the length of the rebar arrangement (arrow), as shown in item 2 in the picture. This will allow for creation in both vertical and horizontal directions. To allow the user to point the location without straight alignment. Condition 2 = User to point 6 locations to create the slab rebar length. If the slab rebar is started at the slab edge (green colour line), user to type "x" and point 1st location, this represents the started point of the rebar, as shown in item 2 in the picture. Automatically, 2nd location to be skipped and continues with the 3rd, 4th, 5th, and 6th location. If slab rebar ended at slab edge (green colour line), user to type "x" and point the 3rd location and 4th location to be skipped. - The start and end of the slab reber shall finish with the 90 deg bent with 100mm length. - Create the default text A7 (T) at the centre. - Create solid circle with 100 diameter at the intersection of the line as shown in the picture. - The line layer to follow the layer as per the drawing attached. Kindly advise the lisp code above. Thanks. Drawing1.dwg
  13. Something like this!? ; ***************************************************************************************************** ; Functions : PLBRJ ; Description : Breaking POLYLINE at blocks insertation points and joined into the one POLYLINE ; Author : Saxlle ; Date : January 19, 2026 ; ***************************************************************************************************** (prompt "\nTo run a LISP type: PLBRJ") (princ) (defun c:PLBRJ ( / ent joinList ptlist ss len spt ept i breakPoint) (setq ent (car (entsel "\nSelect the POLYLINE:")) joinList (list) ptlist (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget ent))) ss (ssget "_F" ptlist (list (cons 0 "INSERT"))) len (sslength ss) spt (vlax-curve-getStartPoint (vlax-ename->vla-object ent)) ept (vlax-curve-getEndPoint (vlax-ename->vla-object ent)) joinList (append (list spt) joinList) i 0 ) (while (< i len) (setq breakPoint (cdr (assoc 10 (entget (ssname ss i))))) (command "_.BREAK" breakPoint "_f" breakPoint breakPoint) (setq joinList (append (list breakPoint) joinList)) (setq i (1+ i)) ) (setq joinList (reverse (append (list ept) joinList)) ss (ssget "_F" joinList (list (cons 0 "LWPOLYLINE"))) ) (command-s "_PEDIT" "m" ss "" "j" "" "") (prompt "\nThe POLYLINE was broken at blocks insert points and joined into the one POLYLINE!") (princ) )
  14. How can I draw this kind of break line on autocad. See file attached. Thanks. 20260119_090353.heic
  15. thks for the reply, that did not work, the 2026 trial version installed without issue. I posted this issue in the autodesk forum, I looked today the moderator removed it
  16. Yes. I tried purge, -purge, audit, overkill, and nothing. I am attaching a link with two versions, one made with lines, arcs, and solids, and another with fonts. Thank you. https://we.tl/t-ydngathEMu
  17. Try this !? You can use POINT or Insert Point of block... Break_Poly@point.lsp
  18. marko_ribar

    Segments of polylines

    I guess you wanted to be orthogonal in relation to current UCS... It is working as desired according to picture you posted... If you always want to make it work in relation to WCS, then you add this line as first : (command "_,ucs" "_w") , and last one should be : (command "_.ucs" "_p")... As for @Tsuky code, you just push that first (defun round_number ... ) into body of main command function (c:regular_draw) and localize it after main defun : (defun c:regular_draw ( / round_number js n_count ent dxf_ent dxf_lst), then you save *.lsp as : "regular_draw.lsp" file, then use APPLOAD command and point to saved "regular_draw.lsp"; CAD should return message : successfuly loaded lisp... Then all you should do is type at Command: regular_draw... You'll be asked to select objects and upon selecting and pressing ENTER, all vertices should jump onto coordinates that are whole numbers (no decimal expansions) [if your SNAPUNIT sys variable is default - 1.0,1.0]... Still with @Tsuky routine, original polylines (or/and other entity types that were selected) will only slightly change vertices positions and therefore it may turn out that orthogonalism won't be processed... So IMHO, you should use both (c:regular_draw) and (c:lw_orth) to make your drawing without problematic portions where inaccuracies of drawn objects may occur...
  19. Tsuky

    Segments of polylines

    The command is "regular_draw", but before to execute it set the variable "RESOL" (value near to your delta X and Y)
  20. You might see if any of this helps. https://forums.autodesk.com/t5/3ds-max-forum/windows-11-is-stopping-3ds-max-opening-and-installing-any-new/td-p/13805917 https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/Unable-to-install-An-error-occurred-while-preparing-the-installation-Please-try-again-or-contact-Autodesk-Support-when-installing-from-Autodesk-Desktop-App.html I had this issue getting Map 3D 2026 installed, Map 3D 2025 installed fine and all the other AutoCAD 2026 and Toolsets installed. Ended up getting Autodesk to install it, since IT didn't want to go through everything. Basically did a bunch of registry resets. You might try installing the latest version's free trial just to see if it installs okay.
  21. Did you try a -Purge? Make the lines and arcs polylines (Pedit M). Do the solid hatches have a border and also outlined with lines and arcs? If so you only need one or the other or even no border/outline at all since it's solid. You might use a file sharing service (like Dropbox, etc.) to share the file, though for just a check on methods to reduce the file size, you could just post a smaller portion of the logo.
  22. Good morning. How can I reduce the file size of this logo? I can't attach it because it's 11MB. How can I post it here? The letters are made with lines and arcs and filled with solid hatching. Thank you very much
  23. Artem

    Segments of polylines

    Thanks, could you help me to use that code. I put that in lisp editor, saved, used appload to load lisp. But i can find these comands to use, either "round_number" or "regular_draw" Where am i wrong?
  24. Artem

    Segments of polylines

    Hi, does it possible to take into account UCS also? I tried to use it in real routine job. Result is above.
  25. Option2 is the correct answer. For option 1 to be correct the orthographic views would need to include dashed lines to show the wall thickness of the vertical cylinder. What you show is a hollow vertical cylinder with a zero wall thickness.
  26. Tsuky

    Segments of polylines

    Maybe another function that could help you... It is essential to set the "RESOL" variable to your resolution wishes before starting the routine, note that this modifies the geometry data of all selected objects. (defun round_number (xr n / ) (* (fix (atof (rtos (* xr n) 2 0))) (/ 1.0 n)) ) (defun c:regular_draw ( / js n_count ent dxf_ent dxf_lst) (setq js (ssget '((0 . "FACE3D,ARC,ATTDEF,ATTRIB,CIRCLE,ELLIPSE,INSERT,LINE,POLYLINE,LWPOLYLINE,*TEXT,POINT,SHAPE,SOLID,TRACE"))) n_count -1) (cond (js (setvar "cmdecho" 0) (command "_.undo" "_group") (while (setq ent (ssname js (setq n_count (1+ n_count)))) (setq dxf_ent (entget ent)) (cond ((eq (cdr (assoc 0 dxf_ent)) "LWPOLYLINE") (setq dxf_lst (cdr dxf_ent) dxf_ent (list (car dxf_ent))) (while (cdr dxf_lst) (if (eq 10 (caar dxf_lst)) (setq dxf_ent (cons (cons 10 (mapcar '(lambda (x p) (round_number x (/ 1 p))) (cdar dxf_lst) (getvar "SNAPUNIT"))) dxf_ent)) (setq dxf_ent (cons (car dxf_lst) dxf_ent)) ) (setq dxf_lst (cdr dxf_lst)) ) (setq dxf_ent (reverse dxf_ent)) ) ((eq (cdr (assoc 0 dxf_ent)) "POLYLINE") (while (eq (cdr (assoc 0 (setq dxf_ent (entget (entnext (cdar dxf_ent)))))) "VERTEX") (setq dxf_ent (subst (cons 10 (mapcar '(lambda (x p) (round_number x (/ 1 p))) (cdr (assoc 10 dxf_ent)) (append (getvar "SNAPUNIT") (list (car (getvar "SNAPUNIT")))))) (assoc 10 dxf_ent) dxf_ent)) (entmod dxf_ent) ) ) (T (foreach n dxf_ent (if (member (car n) '(10 11 12 13 40)) (if (listp (cdr n)) (setq dxf_ent (subst (cons (car n) (mapcar '(lambda (x p) (round_number x (/ 1 p))) (cdr n) (append (getvar "SNAPUNIT") (list (car (getvar "SNAPUNIT")))))) (assoc (car n) dxf_ent) dxf_ent)) (setq dxf_ent (subst (cons (car n) (round_number (cdr n) (/ 1 (car (getvar "SNAPUNIT"))))) (assoc (car n) dxf_ent) dxf_ent)) ) ) ) ) ) (entmod dxf_ent) (entupd ent) ) (command "_.undo" "_end") (setvar "cmdecho" 1) (princ (strcat "\n" (itoa n_count) " transformed object(s).")) ) (T (princ "\nNo find valid object.")) ) (prin1) )
  27. The same, but more condensed... (vl-load-com) (defun c:label ( / l_var js htx AcDoc Space nw_style def_text n obj ename pr dist_start dist_end pt_start pt_end seg_len alpha val_txt nw_obj) (setq l_var (mapcar 'getvar '("AUNITS" "AUPREC" "LUPREC" "LUNITS"))) (mapcar 'setvar '("AUNITS" "AUPREC" "LUPREC" "LUNITS") '(4 3 0 2)) (princ "\nSelect polylines.") (while (null (setq js (ssget '((0 . "LWPOLYLINE"))))) (princ "\nSelection is empty or not are LWPOLYLINE!") ) (initget 6) (setq htx (getdist (getvar "VIEWCTR") (strcat "\nSpecify text height <" (rtos (getvar "TEXTSIZE")) ">: "))) (if htx (setvar "TEXTSIZE" htx)) (setq AcDoc (vla-get-ActiveDocument (vlax-get-acad-object)) Space (if (= 1 (getvar "CVPORT")) (vla-get-PaperSpace AcDoc) (vla-get-ModelSpace AcDoc) ) ) (vla-startundomark AcDoc) (cond ((null (tblsearch "LAYER" "SNA-TXT")) (vlax-put (vla-add (vla-get-layers AcDoc) "SNA-TXT") 'color 7) ) ) (cond ((null (tblsearch "STYLE" "STANDARD")) (setq nw_style (vla-add (vla-get-textstyles AcDoc) "STANDARD")) (mapcar '(lambda (pr val) (vlax-put nw_style pr val) ) (list 'FontFile 'Height 'ObliqueAngle 'Width 'TextGenerationFlag) (list (strcat (getenv "windir") "\\fonts\\arial.ttf") 0.0 0.0 1.0 0.0) ) ) ) (setq def_text "BD/1:200/") (repeat (setq n (sslength js)) (setq obj (ssname js (setq n (1- n))) ename (vlax-ename->vla-object obj) pr -1 ) (repeat (fix (vlax-curve-getEndParam ename)) (setq dist_start (vlax-curve-GetDistAtParam ename (setq pr (1+ pr))) dist_end (vlax-curve-GetDistAtParam ename (1+ pr)) pt_start (vlax-curve-GetPointAtParam ename pr) pt_end (vlax-curve-GetPointAtParam ename (1+ pr)) seg_len (fix (* (- dist_end dist_start) 0.001)) alpha (angle (trans pt_start 0 1) (trans pt_end 0 1)) val_txt (strcat def_text (rtos seg_len 2 0) " m") ) (if (and (> alpha (* pi 0.5)) (< alpha (* pi 1.5))) (setq alpha (+ alpha pi))) (setq nw_obj (vla-addMtext Space (vlax-3d-point (setq pt (polar (vlax-curve-GetPointAtParam ename (+ 0.5 pr)) (+ alpha (* pi 0.5)) (getvar "TEXTSIZE")))) 0.0 val_txt ) ) (mapcar '(lambda (pr val) (vlax-put nw_obj pr val) ) (list 'AttachmentPoint 'Height 'DrawingDirection 'InsertionPoint 'StyleName 'Layer 'Rotation) (list 8 (getvar "TEXTSIZE") 5 pt "STANDARD" "SNA-TXT" alpha) ) ) ) (vla-endundomark AcDoc) (mapcar 'setvar '("AUNITS" "AUPREC" "LUPREC" "LUNITS") l_var) (prin1) )
  1. Load more activity
×
×
  • Create New...