Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. Strydaris

    Table of contents

    @SLW210 Thanks. I will take a look at that. @BIGAL Thanks for the code. We stopped using sheet titles on our titleblocks. Sometimes we would end up having too many drawings on a single page and there wouldnt be enough room for it all on titleblock. We removed it and opted for a Table of Contents with all the labels. And yes we do primarily work in modelspace but all our current titleblocks are located in Paperspace. The drawing titles are located below the drawings in model space. Our table of contents is in modelspace as well. Our model space typically looks like this. Where as our Titleblock version of that looks like this ( the red blob is our company info blanked out)... The fields in the titleblock are linked to dwgprops for easy updating. Page # on the bottom right is a diesel expression that pulls the layout name. Anyways, the only method I can think about doing this is to select each drawing title in model space and have the lisp auto number the pages and organize in a table or formatted MTEXT.
  3. leonucadomi

    SELECT TEXTS OTHER THAN 3.5..HELP

    I ALREADY TRIED IT AND IT SELECTED THEM ALL FOR ME, I DON'T KNOW WHAT HAPPENS My purpose is to detect all texts that do not have a desired height, in this case 3.5
  4. Hi, I use ZWCAD and the Express is loaded I try what GP_ and enthralled said to solve the problem but get this error Command: CPL Error: ZWCAD setvar reject: LOFTNORMALS 0 Any ideas? Thanks
  5. Today
  6. SLW210

    Need better multiline

    At home I have some file compare programs, Notepad++ with the Compare plug-in as well. IIRC, there are some online as well, WinMerge I think is one of my programs, I use AntiTwin to find duplicate files, it may have a compare function. So while everyone is doing there jobs, if YOU have the time, you might could compare the file and see what all is different. At least that will be a start, maybe I can talk IT into putting one of those programs on my work computer. I used to have a program from CabloFil, not sure if they still have anything for doing cable trays in AutoCAD. Here it is... Cable Management 3D Modeling Tools | Legrand I haven't done a cable tray in ages, so not sure what all it does.
  7. You can actually calculate it, here is the code (you can change it for your purposes): (setq ptlist (mapcar 'cdr (vl-remove-if-not (function (lambda (x) (= (car x) 10))) (setq ent (entget (car (entsel "\nSelect the line:")))))) ;; point list sum_x 0 sum_y 0 vertices (cdr (assoc 90 ent)) ;; number of vertices for LWPOLYLINE ) (foreach pt ptlist (setq sum_x (+ sum_x (car pt))) ;; sum only the X vertices values ) (foreach pt ptlist (setq sum_y (+ sum_y (cadr pt))) ;; sum only the Y vertices values ) (setq sum_x (/ sum_x vertices) ;; dividing the total sum X by the number of vertices sum_y (/ sum_y vertices) ;; dividing the total sum Y by the number of vertices pt (list sum_x sum_y) ;; geometric center ) Below are the pictures with geometric center for open and closed polyline (picture 1 open, picture 2 closed). Picture 1. Picture 2. This is true. Best regards.
  8. Only the geometric center is available for closed areas, since open polylines have no area and therefore no true center. If it’s just a line, the "geometric center” is the midpoint.
  9. Steven P

    Need better multiline

    Generally were busy people this week - if you open the LISP in a text editor, search for the line that asks for the new width - problem will be sometime after that - but will narrow down the issue a bit and give a less daunting task
  10. (setq gct (osnap (vlax-curve-getStartPoint bm) "gcen")) The above code line gives only closed polyline How to find the geometric center of an open polyline and a single line
  11. DATVO

    SELECT TEXTS OTHER THAN 3.5..HELP

    Try this: ;; Modified by DV. Visit my page at: https://lispautocad.gumroad.com/ (defun c:PRU (/ ss) (if (setq ss (ssget '((0 . "TEXT,MTEXT") (-4 . "<>") (40 . 3.5)))) (progn (sssetfirst nil ss) (princ (strcat "\nSelecting: " (itoa (sslength ss)) " objects.")) ) (princ "\nNo Object.") ) (princ) )
  12. BIGAL

    Need better multiline

    Like the others 800 lines of code, I struggle remembering what I wrote around that number of lines from a year or two ago. Having to work out why program not working with some new dwg's 678 lines of code at the moment. I had to write an error trap to just find where it was failing. You have been offered other solutions, the Tharwat solution would be my pick and he is a regular here so you could contact him if you had questions or want more.
  13. BIGAL

    Table of contents

    For me I use layouts and a Title block then can make an index of all layouts. Here is a copy of the code have a look at it. It looks from image that your using model space and not layouts. Dwgindex.lsp
  14. DATVO

    join mtext with leader

    Here’s a tool that might help: https://lispautocad.gumroad.com/l/eezilo
  15. Yesterday
  16. hello guys: I need a selection filter to select texts and mtext other than 3.5 in size try this code from Master Lee (ssget '((0 . "CIRCLE") (-4 . "<>") (40 . 5.0))) modified (defun c:pru (/ ss ) (ssget '((0 . "TEXT") (-4 . "<>") (40 . 3.5))) (princ) ) I need to identify texts other than 3.5 with some color. help please thanks
  17. SLW210

    Need better multiline

    I doubt if I'll have time this week.
  18. SLW210

    Table of contents

    https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automated-sheet-index-lisp-assistance/td-p/9057520
  19. Strydaris

    Table of contents

    Hi everyone, I have been looking around to see if anyone has made anything to help in the creation of a "Table of Contents". In my line of work, we need to match exactly the Drawing title to the Table of Contents reference and page number. For Example, the image below shows the ends result that I need. The image below shows what is under the drawings we produce. The title of this drawing is below in red. The above image is incorrectly labeled and should say "A4 MAIN FLOOR PLAN ELEVATION 'A' " (The 10' Ceiling part is not required generally). If there is multiple titles on a page then all of those need to be added to the ToC and might look something like this. A11 PARTIAL BASEMENT PLAN 'B' PARTIAL GROUND FLOOR PLAN 'B' PARTIAL SECOND FLOOR PLAN 'B' We currently use a formatted MTEXT to hold all this information where the A## is the page number on a new line and the contents is 2 tabs over. We use also use 2 columns for the list. So What I was thinking is having an auto numbering Page number in a lisp and then selecting the drawing titles to add next to the page number. In theory this will work but I have 2 major issues that I cant seem to get around right now. First, if the drawings titles that I select is an mtext with formatting, I cant find a way around removing the formatting. I am using ACAD 2024 LT and Lee Mac's "LM:Unformat string" doesnt work, neither does StripMtext. Does anyone have an idea to get around this? Secondly, I do not know how to build an mtext to include new formatting. Like how do you make sure you start a new line or add tabs before the next piece of text is added to the mtext? I am even up for other suggestions on how to create a Table of Contents.... except I cant use Sheet Sets. Our office doesn't want move in that direction just yet. Thanks.
  20. Steven P

    Need better multiline

    .... 800+ lines of code to look at, understand and then to work out a fix....
  21. pkenewell

    join mtext with leader

    Did you increase the Fuzz factor value? The MTEXT objects may be further away from the leader ends than the default 0.1, which if you are working in mm is a pretty small value.
  22. The AutoCAD Blog

    Object Snaps Basics: AutoCAD Foundations

    Geometry and dimensions need to be placed precisely within your drawings to ensure accuracy when your digital design is taken into the real world to be manufactured or built. There are several precision features available when creating and modifying objects, including: Coordinate entry: Specify a location by its Cartesian or polar coordinates, either absolute or relative. Polar tracking: Snap to the closest preset angle and specify a distance along that angle. Locking angles: Lock to a single specified angle and specify a distance along that angle. Direct distance entry: Locate the next point at a specified distance in the direction of your cursor. Object snaps: Snap to precise locations on existing objects, such as an endpoint of a polyline, the midpoint of a line, or the center point of a circle. Grid snaps: Snap to increments on a rectangular grid. For our AutoCAD Foundations blog series today, we’re taking an overview look at one of the most popular precision features: object snaps. For the full tutorial on using object snaps and even more of these features listed above, you can check out the AutoCAD Foundations article. In the meantime, let’s take a look at what object snaps are and can do for you. Get Started With Object Snaps Objects that make up your designs rarely fall on precise coordinates. By far, the most important way to specify precise locations on objects is to use object snaps. In the following illustration, several different kinds of object snaps are represented by markers. Object snaps become available during a command whenever you are prompted to specify a point. For example, as you draw a new line and move the cursor near the endpoint of an existing line, the cursor will automatically snap to it and is identified with an AutoSnap marker and tooltip. AutoSnap Marks of Common Object Snaps The following table illustrates commonly used object snaps. Learn More Precision Features Be sure to check out the entire AutoCAD Foundations article for even more in-depth tutorials on object snaps and a variety of precision features. And stay tuned for our entire series here on the blog (or catch up on past articles!) as we highlight even more great tips for getting started with AutoCAD. The post Object Snaps Basics: AutoCAD Foundations appeared first on AutoCAD Blog. View the full article
  23. HypnoS

    Need better multiline

    Ill look into them, although I would appreciate if someone would at least fix this bug i mentioned.
  24. JeJe

    join mtext with leader

    The lisp doesn't work for me 2393 Leaders Selected : 0 MTEXT objects associated.
  25. mhy3sx

    Help with the code : 2d stair

    Thanks for the help DATVO and Saxlle.
  26. Saxlle

    Help with the code : 2d stair

    @mhy3sx I made the same command (I hope the ZWCAD have the same functions as AutoCAD), but with the less line code and a different approach. It works the same as @DATVO modified your code, the result is the same. ; ******************************************************** ; Functions : stair2D ; Description : Drawing 2D stairs between two LINE ; Author : SAXLLE ; Date : August 07, 2025 ; ******************************************************** (prompt "\nTo run a LISP type: stair2D") (princ) (defun c:stair2D ( / old_osmode old_aunits old_layer flag ent pt1 pt2 pt3 dist num_steps equal_offset half_dist ang new_ang circle_radius off npt midptdel midptbase val midpt1 midpt2 midpt3 answ) (setq old_osmode (getvar 'osmode) old_aunits (getvar 'aunits) old_layer (getvar 'clayer) ) (setvar 'aunits 0) (setq flag T) (while (not (equal flag nil)) (setvar 'osmode 1) (setq ent (car (entsel "\nSelecte the BASE line:\n"))) (while (or (equal ent nil) (not (equal (cdr (assoc 0 (entget ent))) "LINE"))) (prompt "Try again...") (princ) (setq ent (car (entsel "\nSelecte the BASE line:\n"))) ) (setq pt1 (getpoint "\nPick the first point of the BASE line:\n") pt2 (getpoint pt1 "\nPick the second point of the BASE line:\n") pt3 (getpoint pt1 "\nGet the distance between BASE line and PARALLEL line:\n") dist (distance pt1 pt3) num_steps (getint "\nEnter the number of STEPS:") equal_offset (/ (getpropertyvalue ent "Length") num_steps) half_dist (/ dist 2) ang (angle pt1 pt2) new_ang (angle pt1 pt3) circle_radius 0.06 off 0.0 npt (list) ) (setvar 'osmode 0) (if (not (tblsearch "LAYER" "STAIR")) (command "_-layer" "_m" "STAIR" "_c" "90" "" "") (setvar 'clayer "STAIR") ) (command-s "_UNDO" "begin") (setq midptdel (mapcar '* (mapcar '+ pt1 pt3) '(0.5 0.5))) (command-s "_ERASE" midptdel "") (command-s "_LINE" pt1 (strcat "@" (rtos dist 2 2) "<" (angtos new_ang)) "") (setq midptbase (mapcar '* (mapcar '+ (getpropertyvalue (entlast) "StartPoint") (getpropertyvalue (entlast) "EndPoint")) '(0.5 0.5))) (command-s "_CIRCLE" midptbase circle_radius "") (repeat num_steps (setq val (vlax-curve-getPointAtDist (vlax-ename->vla-object ent) off) npt (append npt (list val)) off (+ off equal_offset) ) ) (setq npt (reverse npt)) (foreach pt npt (command-s "_LINE" pt (strcat "@" (rtos dist 2 2) "<" (angtos new_ang)) "") ) (setq midpt (mapcar '* (mapcar '+ (getpropertyvalue (entlast) "StartPoint") (getpropertyvalue (entlast) "EndPoint")) '(0.5 0.5)) midpt1 (mapcar '* (mapcar '+ (getpropertyvalue (entlast) "StartPoint") midpt) '(0.5 0.5)) midpt2 (mapcar '* (mapcar '+ (getpropertyvalue (entlast) "EndPoint") midpt) '(0.5 0.5)) midpt3 (polar midpt ang (/ half_dist 2)) ) (command-s "_LINE" midptbase (strcat "@" (rtos (getpropertyvalue ent "Length") 2 2) "<" (angtos ang)) "") (command-s "_LINE" midpt1 midpt3 midpt2 "") (command-s "_UNDO" "end") (initget 1 "Yes No Undo") (setq answ (getkword "\Do you want to continue? [Yes/No/Undo]")) (cond ((equal answ "No") (setq flag nil) ) ((equal answ "Undo") (command-s "_UNDO" "") ) ) (setvar 'osmode 1) ) (command-s "_regen") (setvar 'osmode old_osmode) (setvar 'aunits old_aunits) (setvar 'clayer old_layer) (prompt "\nThe 2D stairs are drawn!") (princ) ) This is the example video. STAIR2D.mp4 Best regards.
  27. Here is the code @mhy3sx, based on your original file. I've modified a few lines using a different approach, but the result remains the same. If you find this helpful, feel free to visit my page where I share tools designed to improve efficiency and save time, as effortlessly as enjoying a cup of coffee: https://lispautocad.gumroad.com/ ;; Modified by DV. Visit my page at: https://lispautocad.gumroad.com/ (defun c:Stair2D (/ p1 p2 ent start_pt end_pt mid_pt line_length circle_diameter num_steps i move_vec array_vec step_vec last_start_pt last_end_pt last_mid_pt mid1mid2_vec mid1mid2_length unit_vec perp_vec arrow_p1 arrow_p2 arrow_p3) (vl-load-com) (setvar "CMDECHO" 0) (command "._UNDO" "_BEGIN") (if (not (tblsearch "LAYER" "STAIR")) (command "_layer" "_m" "STAIR" "_c" "90" "" "") ) (setvar "CLAYER" "STAIR") (princ "\nSelect the first LINE of the staircase: ") (while (not (setq ent (ssget ":S" '((0 . "LINE"))))) (princ "\nTry again!! ") ) (command "._CHANGE" ent "" "_P" "_LA" "STAIR" "") (setq ent (ssname ent 0)) (setq ent_data (entget ent)) (setq start_pt (cdr (assoc 10 ent_data))) (setq end_pt (cdr (assoc 11 ent_data))) (setq mid_pt (mapcar '(lambda (a b) (/ (+ a b) 2.0)) start_pt end_pt)) (setq line_length (distance start_pt end_pt)) (setq circle_diameter (/ line_length 10.0)) (princ "\nSelect the start of the staircase: ") (setq p1 (getpoint)) (princ "\nSelect the end of the staircase: ") (setq p2 (getpoint p1)) (initget 7) (setq num_steps (getint "\nEnter the number of steps: ")) (setq array_vec (mapcar '- p2 p1)) (setq step_vec (mapcar '(lambda (x) (/ x num_steps)) array_vec)) (setq i 1) (while (<= i num_steps) (setq move_vec (mapcar '(lambda (x) (* x i)) step_vec)) (command "._COPY" ent "" "_non" (list 0 0 0) "_non" move_vec) (setq i (1+ i)) ) ;; Circle and arrow line (command "._CIRCLE" mid_pt (/ circle_diameter 2.0)) (setq last_start_pt (mapcar '+ start_pt (mapcar '(lambda (x) (* x num_steps)) step_vec))) (setq last_end_pt (mapcar '+ end_pt (mapcar '(lambda (x) (* x num_steps)) step_vec))) (setq last_mid_pt (mapcar '(lambda (a b) (/ (+ a b) 2.0)) last_start_pt last_end_pt)) (command "._LINE" mid_pt last_mid_pt "") (setq mid1mid2_vec (mapcar '- last_mid_pt mid_pt)) (setq mid1mid2_length (distance mid_pt last_mid_pt)) (if (> mid1mid2_length 0) (progn (setq unit_vec (mapcar '(lambda (x) (/ x mid1mid2_length)) mid1mid2_vec)) (setq perp_vec (list (- (cadr unit_vec)) (car unit_vec) 0.0)) (setq arrow_p1 (mapcar '+ last_mid_pt (mapcar '(lambda (x) (* x 0.10 mid1mid2_length)) unit_vec))) (setq arrow_p2 (mapcar '+ last_mid_pt (mapcar '(lambda (x) (* x -0.15 mid1mid2_length)) perp_vec))) (setq arrow_p3 (mapcar '+ last_mid_pt (mapcar '(lambda (x) (* x 0.15 mid1mid2_length)) perp_vec))) (command "._LINE" arrow_p1 arrow_p2 "") (command "._LINE" arrow_p1 arrow_p3 "") ) ) (command "._UNDO" "_END") (setvar "CMDECHO" 1) (setvar "CLAYER" "0") (princ) )
  28. Last week
  1. Load more activity
×
×
  • Create New...