All Activity
- Yesterday
-
If your making layouts then do that then go into mspace pick the page details than pop back to pspace and fill in your title block not that hard. Yes a lisp. One of the things I have looked at is pick a point on dwg in Model space, select scale, select title block and make the layout. You could add pick the mtext for title block also. It will cost you a cup of coffee as have to hard code the title block details etc.
-
Geometric center of open polyline, line
BIGAL replied to maahee's topic in AutoLISP, Visual LISP & DCL
Not quite the middle of say 2 points. The red is the average answer. The green is gcen. so 4 answers. If the shape is say 4 points then you could force a close get the Gcen then do a undo. -
SELECT TEXTS OTHER THAN 3.5..HELP
leonucadomi replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
thanks, now I explain In the modelspace I have texts of different height in paperspace in the paperspace I have viewports of different scales If I use the chspace command and take those texts to paper space they should be 3.5 height I'm looking for a routine that helps me detect which texts do not meet that height in each viewport (defun c:test (/ EscVP StrScale2 StrScale) (setq old_err *error*)(defun *error* ( a / )(princ "") (setq *error* old_err)(princ)) (setvar "cmdecho" 0) (if (and (setq EntVP (car (entsel "\Seleccione VIEWPORT: "))) (= (cdr (assoc 0 (entget EntVP))) "VIEWPORT")) (progn (setq EscVP (vla-get-CustomScale (vlax-ename->vla-object EntVP))) (setq StrScale2 (rtos (* 3.5 (/ 1 EscVP)) 2 1)) (setq StrScale (rtos (/ 1 EscVP) 2 2) ) (setq vpnum (cdr (assoc 69 (entget EntVP ) ) ) ) (vl-cmdf "_.mspace") (setvar "CVPORT" vpnum) (setq ss (ssget '((0 . "TEXT") (-4 . "<>") (40 . 3.5))) ) (Prompt (strcat "\nLa escala de La Ventana es 1/" StrScale)) (princ "\nLos textos de 3.5 en el interior de la ventana deben ser de: ") (princ StrScale2) ) ) (setvar "cmdecho" 1) (princ) );fin defun I am looking to enter this calculated value here but it doesn't work -
Steven P started following SELECT TEXTS OTHER THAN 3.5..HELP
-
SELECT TEXTS OTHER THAN 3.5..HELP
Steven P replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
This (ssget '((0 . "TEXT") (-4 . "<>") (40 . 3.5))) should work. You can change "TEXT" to "*TEXT" to also capture MText Though looking at the code you have, I am assuming that is just a snippet of what you want to do. Here are a couple of hints: (defun c:pru ( / ss ) ;;Yup localised variables, C: prompt, all good (setq ss (ssget '((0 . "TEXT") (-4 . "<>") (40 . 3.5))) ) ;; ADDED (SETQ SS ... ) so that you can use the selection set later (princ (sslength ss)) ;; Added this in to show the result of the selection set (princ) ;;Exit quietly ) -
SELECT TEXTS OTHER THAN 3.5..HELP
leonucadomi replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
(defun c:pru2 ( / ss alturaColor colorNuevo) (setq alturaColor 3.5) ; Define la altura a verificar (setq colorNuevo 1) ; Define el color a aplicar (ej. rojo) (setq ss (ssget "X" '((0 . "TEXT,MTEXT")))) ; Selecciona todos los textos (if ss (progn (setq i 0) (while (setq en (ssname ss i)) (setq obj (vlax-ename->vla-object en)) (if (/= (vla-get-height obj) alturaColor) (vlax-put-property obj 'color colorNuevo) ; Cambia el color ) (setq i (1+ i)) ) ) ) (princ) ) This routine does what I need, but it has a problem that I cannot understand, I have objects in the paperspace that have a height of 3.5 and it recognizes them as if they did not have it and changes them to red. can someone help? thanks -
Dadgad started following SNAP mode hints
-
SNAP mode hints
Dadgad replied to Discus84's topic in AutoCAD 2D Drafting, Object Properties & Interface
LI & LU Layer isolate and Layer unisolate are extremely helpful, I concur. I also favor "all off" rather than "Fade". I am quite partial to the LAYERS 2 toolbar also. -
@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.
-
SELECT TEXTS OTHER THAN 3.5..HELP
leonucadomi replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
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 -
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
-
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.
-
Saxlle started following Geometric center of open polyline, line
-
Geometric center of open polyline, line
Saxlle replied to maahee's topic in AutoLISP, Visual LISP & DCL
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. -
Geometric center of open polyline, line
DATVO replied to maahee's topic in AutoLISP, Visual LISP & DCL
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. -
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
-
(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
-
SELECT TEXTS OTHER THAN 3.5..HELP
DATVO replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
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) ) -
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.
-
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
-
Here’s a tool that might help: https://lispautocad.gumroad.com/l/eezilo
- Last week
-
leonucadomi started following SELECT TEXTS OTHER THAN 3.5..HELP
-
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
-
I doubt if I'll have time this week.
-
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/automated-sheet-index-lisp-assistance/td-p/9057520
-
Strydaris started following 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.
-
Steven P started following Need better multiline
-
.... 800+ lines of code to look at, understand and then to work out a fix....
-
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.
-
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