Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/03/2023 in all areas

  1. It was closing bracket here : (setq s (ssget '((0 . "POINT")))) I've updated the code... Sorry, I overlooked those initial (setq's...
    1 point
  2. Ah, yes, I understand. So c:txtchange runs the function without the c:, it collects the information required to run the second function (in this case the new text and the name of the text item to change). It gets the second function to run with this line: (txtchange texta ent1) Where texta is the new text string and ent1 is the name of the text entity to change. You could combine the 2 functions if you wanted but I'll often make a core function without the c:, in this case to change a text, and I can link many other functions to run it. For example, I have another function that increments a number, the first function does all that calculation and then the updating uses the one above, another I have copies texts from one to another.. again a first function to get the text string to copy and then the above to update the new text. Saves copying the same thing many times and only needs 1 update if I change my way of thinking ever. So to use the code without the 'c:' you can use this in your code: (txtchange **New Text String** **Text Entity Definition**) where the **Text Entity Definition** is what you might get from: (setq TextEnt (car (entsel "\nSelect a text string: "))) Note also that the codes above might appear to be a long way round, they are shortened versions that run a whole load of things - the whole LISP file is quite large and LISPs in it are linked, shortened here to answer the question asked
    1 point
  3. Has been asked many times before Google "export linework co-ordinates to csv Autocad lisp" Again post a sample dwg . "also the name for the layer its on??" Do you want direct to excel ? Do you want line counts by layer and length ? Just getting to the next request after code is posted.
    1 point
  4. "This is part of a Lisp to select touched polylines." Show say a dwg or image what is previous selection set. You can also do the repeat for items in a selection set much easier. (repeat (setq K (sslength Pr_PolySelection)) (setq polyent (ssname ss (setq k (1- k)))) .... ) If I understand you want a single bounding box of selected objects ? You seem to be doubling up on what your asking for.
    1 point
  5. How does this work for a starter? https://autocadtutorial22.blogspot.com/2020/04/15-13a-autocad-export-coordinates.html ;;https://autocadtutorial22.blogspot.com/2020/04/15-13a-autocad-export-coordinates.html (defun C:c2exc2 (/ coords coor_list elist en fd fname i ss) (setq ss (ssget "_:S" '((0 . "*POLYL*,LINE,CIRCLE,ARC,ELLIPSE,SPLINE,POINT"))) i -1 ) (repeat (sslength ss) (setq i (1+ i) en (ssname ss i) elist (entget en) coords (vl-remove-if (function not) (mapcar (function (lambda (x)(if (eq 10 (car x))(trans (cdr x) 0 1)))) elist) ) coor_list (cons coords coor_list)) ) (setq coor_list (reverse coor_list)) (setq fname (getfiled "Type file name" "" "csv" 1)) (setq fd (open fname "w")) (foreach coors coor_list (foreach i coors (princ (strcat (rtos(car i)) "\t" (rtos (cadr i))"\t" (rtos (caddr i)) "\n") fd ) ) ) (close fd) (princ) )
    1 point
  6. If you convert this to MTEXT using the Text2MText command: ABCDEFGHIJKL 12345678910 ABCDEFGHIJKL 12345678910 ABCDEFGHIJKL 12345678910 You will get this.... ABCDEFGHIJKL 12345678910 ABCDEFGHIJKL 12345678910 ABCDEFGHIJKL 12345678910 I want to create a single MTEXT object from my selection but also retain the original formatting/spacing without having to go into the settings dialog each time. In the TXT2MTEXT command under SETTINGS there are two options that I would to access/change in a simple lisp routine. Under the SETTINGS dialog I want to uncheck WORD WRAP and uncheck FORCE UNIFORM LINE SPACING (which is only available AFTER unchecking WORD WRAP). Can someone provide some guidance on how to do this in Autolisp? I am not asking someone to write a routine for me only explain how to change these settings in AUTOLISP. Are there command line options for these? I'm not a VLISP guy so "old school" is how I will code what I need. (I like to see how to do it in VLISP but I'm not even a novice VLISPer <yet anyway>)
    1 point
  7. You're most welcome abra-CAD-abra
    1 point
×
×
  • Create New...