Leaderboard
Popular Content
Showing content with the highest reputation on 05/23/2022 in all areas
-
Sorry i had some code worked up but its on my home pc ill post it when I get home.2 points
-
And easy midpoint of two points add them up and divide x y and z by 2 inverse answer (setq mpt (mapcar '* (mapcar '+ pt1 pt2) '(0.5 0.5 0.5)))2 points
-
Version 1.7.0
3,315 downloads
This program will calculate the total length of Lines/Polylines/LWPolylines/Arcs/Ellipses/Circles/Splines with an optional filter. The Filter may be used to select only those lines that are on a certain layer, or perhaps have a certain linetype or colour. The results of the calculation can be displayed in an ACAD Table within the drawing, or written to either a CSV or TXT File. The Table-Style may be selected from the drop-down in the main dialog. Main interface The main dialogue box allows the user to filter lines by layer, linetype or colour and select the table style. Multiple selected items can filtered. A filter string may be entered to help the user quickly find the filter items that he/she requires. Options The options dialogue box allows the user to specify which object types should be included and the type of output, table in the drawing, CSV file or TXT file. Demo Function Syntax: LenCal For instructions on how to run the program see here. Any comments, criticism and suggestions are welcome. Either PM me directly, or reply to the original thread.1 point -
Version 1.0.0
2,720 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 -
@exceed It has to be a completely different name. If you insert a block from another drawing by copy and paste even tho it has different layers/colors/entity's if their is already a block with that name in the block library then AutoCAD uses the defined block. --edit--oops missed step 5 Ask me how I know that? about 4-5 years ago we would just make quick blocks named block-1, block-2, block-3... everything was fine for about 2 months then someone was like "ill take a block from this drawing and put it into this drawing". messed up about a weeks worth of work because the profiles were different enough that the material we were cutting was unusable. but not so different that when you pasted the block you noticed a difference. Why I use this in my quick block lisp ;;;======================================================================== ;;; *** AUTO-BLOCK.LSP *** ;;; BLOCK CREATION ON THE FLY : "Just select your objects" ;;; By Raymond RIZKALLAH, October/2004 ;;;======================================================================== (defun Set_BlkName () (setq o-dmzn (getvar "dimzin")) (setvar "dimzin" 0) (setq c-date (getvar "cdate")) (setq w-all (rtos c-date 2 20)) ;; >> "20041022.11423489" (setq w-yr (substr w-all 3 2)) ;; ["01" to "99"] >> "04" (setq w-mn (substr w-all 5 2) ;; ["A" to "L"] >> "J" w-mn (chr (+ 64 (read w-mn))) ;; ) (setq w-dy (substr w-all 7 2)) ;; ["A" to "Z" + "1" to "5"] >> "V" (if (<= (read w-dy) 26) ;; (setq w-dy (chr (+ 64 (read w-dy)))) ;; (setq w-dy (rtos (- (read w-dy) 26) 2 0)) ;; ) (setq w-hr (substr w-all 10 2) ;; ["A" to "S"] >> "K" w-hr (chr (+ 64 (read w-hr))) ;; ) (setq w-mt (strcat (substr w-all 12 1) "-" (substr w-all 13 1))) ;; ["00" to "59"] >> "4-2" (setq w-sc (substr w-all 14 2)) ;; ["00" to "59"] >> "34" (setq w-mm (substr w-all 16 2)) ;; ["00" to "59"] >> "89" (setq blkname (strcat "$" w-mn w-sc w-hr w-mt w-dy w-yr w-mm)) ;; >> "$J34K4-2V0489" (setvar "dimzin" o-dmzn) (princ) )1 point
-
1 point
-
I initially used different door blocks. What later switched to an arc is entered with point1 point2 and radius. A little later I wanted to be able to color the arc and I have now succeeded with that code from expert Lee Mac. The code here is just an example of what I wanted to achieve because I break the walls to put the doors in there and everything goes as planned! (Photo attachment) It remains for me to thank you both!1 point
-
This is a common request and has been asked many times take a pline and label points, do a google you should find what you want. It may be over at forums/autodesk was asked for very recent Google "label pline chainage autocad lisp"1 point
-
1 point
-
@mhupp Thanks!!! (Again... ) What I did not realized is that i can use this: (8 . "MAINLINE_PIPES,ZONE_PIPES,Circular sectors,SPRAYLINES") and the "," is like OR condition. I've made a small change to the code, deleteing the OR condition of the colors since they appear in the list and the loop compare the original color and assign the lines to the new layer that have the color and the line width according to the condition in the list. here is the relevant code segment that I've changed a little (the actual datalist contains about 35 layers so I obviously didn't copied all of them...) : (if (setq ss (ssget "_X" '((0 . "LINE") (8 . "MAINLINE_PIPES,ZONE_PIPES,Circular sectors,SPRAYLINES")))) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (setq eData (mapcar '(lambda (d) (cdr (assoc d (entget ent)))) '(62 10 11))) (entdel ent) (setq f (assoc (car edata) Datalist)) (entmakex (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(90 . 2) '(70 . 0) (cons 8 (cadr f)) (cons 43 (caddr f)) (cons 10 (cadr eData)) (cons 10 (caddr eData)) ) ) ) ) I've attached the full lisp here as a file. Thanks Again, Ari. test3.lsp1 point
-
The sections of ssget that are strings you can just use , to select multiples instead of (-4 . "<or"). simplified the color filter by removing the mapcar since its short list. Also used the foreach method instead of using i (defun c:test (/ Datalist ss ent eData f) (setvar 'CECOLOR "BYLAYER") (setq Datalist '((6 "P_DN50-6" 0.15)(22 "P_DN32-6" 0.05)(54 "P_DN25-4" 0.05)(94 "P_DN40-6" 0.10)(214 "P_DN50-10" 0.15))) (if (setq ss (ssget "_X" '((0 . "LINE") (8 . "MAINLINE_PIPES,ZONE_PIPES,Circular sectors,SPRAYLINES") (-4 . "<or") (62 . 6) (62 . 22) (62 . 54) (62 . 94) (62 . 214) (-4 . "or>")))) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (setq eData (mapcar '(lambda (d) (cdr (assoc d (entget ent)))) '(62 10 11))) (entdel ent) (setq f (assoc (car edata) Datalist)) (entmakex (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(90 . 2) '(70 . 0) (cons 8 (cadr f)) (cons 43 (caddr f)) (cons 10 (cadr eData)) (cons 10 (caddr eData)) ) ) ) ) (princ) )1 point
-
Rectangles and Polylines can only be drawn in the XY plane. If you want to create these elements in the Front view you will need to rotate your UCS. Type UCS at the command prompt and hit Enter. Look at the command line to see your options. If you type X and hit Enter, then type 90 and hit Enter, your UCS will rotate 90 degrees around the X axis and you will then be able to draw Polylines and Rectangles in the Front view. Take a look at the link below to learn more about the UCS command. https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-Core/files/GUID-0BE49DA1-B323-4758-B49B-4C497D194C7A-htm.html1 point
-
For the user inputs you might be able to reduce ths. For example cable and transfomer sizes tend to be discrete, unlikely to get an AWG 3.12 cable or 13.25mm or a 11.56kVA Trasformer. Your work might make this even easier that you mightonly ever specify 3 or 4 sizes of transformer and only low voltage (120 / 220V) cable and one or 2 cable sizes. So from that it might be that you can make up a data table, or simple calculation to calculate the max lengths Your user input might be something like this: "Select Line or enter [s] for settings" and in settings they can enter transformer and cable sizes, perhasp saved into the regisetry for future next time it s used. Making up the data table / look up table / cable calulation might take you a little effort but could reduce the work required, taking away some of the set up time.1 point
-
And easy midpoint of two points add them up and divide x y and z by 2 (setq mpt (mapcar '/ (mapcar '+ pt1 pt2) '(2 2 2)))1 point
-
Its quite with many codes to cover the process correctly, would like to write it for you but I need a few encouragements.1 point
-
From the blocks you have in your sample the LISP above should give you the centre since they are all -nearly- rectangles1 point
-
This is exactly what i expect Thanks, exceed but i have request for this 1. Can you do this for ucs also? 2 as attached drawing there is one ore item is coming with leader so vertical text i cannot arrange (i think that is landing point) TEST.dwg1 point