Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. To avoid confusion: I've separated each resulting perimeter from the model drawing to show it in this example. In reality, each perimeter logically overlaps the others.
  3. Agree with Lee look into lisp built in functions, if you use Autoload function then its easy just need to add one lisp to the Start Up Suite. An example of the lsp file. (autoload "COPY0" '("COPY0")) (autoload "COPYCOMMAND" '("ZZZ")) (autoload "COVER" '("COVER")) (autoload "DIMFLIP" '("DIMFLIP")) (autoload "DRAWXFALL" '("DRAWXFALL")) (autoload "DRAWPIPE" '("DRAWPIPE")) ..... add more
  4. I asked a similar question for a task. It groups common items not sure if it is useful as no data to test on. ; Thanks to Dexus for groupby sep 2025 (defun _groupBy (fun lst0 / itm old rtn) (while lst0 (setq itm (fun (car lst0)) rtn (if (setq old (assoc itm rtn)) (subst (cons itm (cons (car lst0) (cdr old))) old rtn) (cons (cons itm (list (car lst0))) rtn) ) lst0 (cdr lst0) ) ) (mapcar 'cdr rtn) ) (setq lst (vl-sort lst '(lambda (x y) (< (car x)(car y))))) (setq lst2 (_groupBy (lambda (e) (car e)) lst))
  5. Hi. A simple example. The main label is always a Roman numeral followed by a : or + to indicate, respectively, a floor plan with a particular feature or a number of volumes with another additional element above it. There are many more possible combinations, but I'll stick with a simple example. ctePns.dwg
  6. Today
  7. I think it's time you started to learn AutoLISP @Nikon
  8. I need to add 50 lisp programs to autoload... I want to be able to upload lisp files not one, but in a list.
  9. That is because that is an AI generated function that does not exist. Rather than add them to the startup suite, just load them using one lisp file: (defun loadlisp (path / lst pth) (if (and (setq pth (strcat (vl-string-right-trim "\\" path) "\\")) (setq lst (vl-directory-files pth "*.lsp" 1)) ) (foreach x (mapcar 'vl-filename-base lst) (vl-catch-all-apply 'load (list (strcat pth x)))) ) (princ) ) (loadlisp "C:\\Program Files\\Autodesk\\AutoCAD 2021\\Support\\") Easy to inspect in the vlide:
  10. Good day everyone! I want to add several lisp files to the startup at once. I have a list of lisp files in notepad, in the Support folder. The code returns an error: no function definition: VLA-GET-STARTUPSUITE (defun c:add-list-lisps-to-startup ( / file line folder fullpath app ssuite ) (vl-load-com) ;; The folder where the LISP files are located (setq folder "C:/Program Files/Autodesk/AutoCAD 2021/Support/") ;; Opening the list file (setq file (open "C:/Program Files/Autodesk/AutoCAD 2021/Support/list_startup.txt" "r")) (if file (progn ;; Getting the object Application (setq app (vlax-get-acad-object)) (setq ssuite (vla-get-StartupSuite app)) (while (setq line (read-line file)) (setq line (vl-string-trim " \t\r " line)) (if (and line (> (strlen line) 0)) (progn (setq fullpath (strcat folder line)) (if (findfile fullpath) (progn (vla-Add ssuite fullpath) (princ (strcat "Added to auto-upload: " fullpath)) ) (princ (strcat "File not found: " fullpath)) ) ) ) ) ; end while (close file) (princ "All files from the list have been processed.") ) ; end progn (princ "Couldn't open the list file.") ) ; end if (princ) ) ; end defun
  11. Here's another example - for the below function, "unq" will contain the items with unique MAT value, and "dup" will contain those for which there is more than one MAT value: (defun foo ( lst / dup key len unq ) (while (setq itm (car lst)) (setq key (car itm) len (length dup) lst (vl-remove-if (function (lambda ( x ) (if (= key (car x)) (setq dup (cons x dup))))) (cdr lst)) ) (if (< len (length dup)) (setq dup (cons itm dup)) (setq unq (cons itm unq)) ) ) (list unq dup) ) Though it's probably more efficient to use the lists directly in your code rather than the above function returning a list of lists - alternatively, output parameters may be used, e.g.: (defun foo ( lst unq-out dup-out / dup key len unq ) (while (setq itm (car lst)) (setq key (car itm) len (length dup) lst (vl-remove-if (function (lambda ( x ) (if (= key (car x)) (setq dup (cons x dup))))) (cdr lst)) ) (if (< len (length dup)) (setq dup (cons itm dup)) (setq unq (cons itm unq)) ) ) (set unq-out unq) (set dup-out dup) nil ) _$ (foo '(("abc" 1) ("def" 2) ("abc" 3) ("xyz" 4) ("abc" 5)) 'unq-sym 'dup-sym) nil _$ unq-sym (("xyz" 4) ("def" 2)) _$ dup-sym (("abc" 1) ("abc" 5) ("abc" 3)) Note that the element order is not preserved with the above.
  12. I'm unsure if you're looking to group the items by the MAT value or something else (sample data and the expected result would help in this regard), but I might suggest manipulating the data into groups using the MAT value as the key, i.e. (defun foo ( lst / ass rtn ) (foreach itm lst (if (setq ass (assoc (car itm) rtn)) (setq rtn (subst (vl-list* (car ass) itm (cdr ass)) ass rtn)) (setq rtn (cons (list (car itm) itm) rtn)) ) ) )
  13. Try Lee Mac's "List Duplicates" functions at the following link: https://www.lee-mac.com/uniqueduplicate.html#listdupes
  14. Hello everyone, I'm looking for a solution to efficiently extract from a given list all duplicates. I've got a solution that works in theory but that is ineficient in practice due to the length of the list I want to analyse (approximately 25 000 elements). The list I'm working with is a list of lists. All individual lists decribe a Covadis bloc (topography software) with the format (MAT, ALT, ALTI, (X, Y, Z), ename of the bloc). MAT, ALT and ALTI are attributes value of the bloc and (X, Y, Z) is the insert coordinates. I want to isolate all the blocs that have the same MAT attribute and save them on a separate list. I have come with the solution described in the code below but it's much to slow and absolutely not opimised. ; lst = general list with bloc caracteristics ; sublst format (MAT, ALT, ALTI, (X, Y, Z), ename) (while (setq sublst (car lst)) (setq lst_same_mat (vl-remove nil (mapcar '(lambda(p) (if (equal (car p) (car sublst)) p nil)) lst))) (setq lst_same_mat_save (cons lst_same_mat lst_same_mat_save)) (setq lst (REMOVE_LST1FROM_LST2 lst_same_mat lst_same_mat_save) ) ;;;; ;lst_gen : list we want to suppress certain element from ;lst_suppr : list of elements to be suppressed in lst_gen (defun REMOVE_LST1_FROM_LST2 (lst_suppr lst_gen / ele_suppr lst_modif n) (setq n 0) (setq lst_modif lst_gen) (while (setq ele_suppr (nth n lst_suppr)) (setq lst_modif (vl-remove ele_suppr lst_modif)) (setq n (1+ n)) ) lst_modif ) Would anyone have an idea on how to speed this up for large list ? Thanks and best regards, Jacques
  15. CyberAngel

    Parcel number and name problem

    I created a parcel. I gave it a number and a name. I modified the default label to include the number, a slash, and the name. Now the parcel has a label that looks like what I believe you want. If that's not correct, please elaborate.
  16. Butch

    Parcel number and name problem

    I want that the parcel number can be writen with / when desired....egsample 1852/3
  17. It sounds like some fairly simple AutoLISP code would handle this. You'd have to specify where to get the data, how to format it, and where to put it. For instance, the "label" including the number of floors: is that a block, a piece of text, an annotation in Revit, or something else? Is the number part of a code with letters and numbers, or is it just one number? Would all the "perimeters" go to the same height or to different heights? What format would the layer names have, and is the floor number the only variable? There are a lot of blanks to fill in here.
  18. CyberAngel

    Parcel number and name problem

    Parcels have numbers (integers) but also names (strings). Do you want to format the name so that it includes the original number plus a slash, plus some other number (could be total parcels)? That could be as simple as changing the parcel label style. If it's something more complicated, you might need some code. I'm not sure what you want.
  19. @PGia please upload your sample.dwg, before and after
  20. Hi I’m wondering if this topic has been discussed in this forum before. In simplified terms, the issue is this: if you have a 2D perimeter with inner sub-perimeters, and within each of them there’s a label indicating the number of floors rising above that perimeter — would it be possible to create, for each floor, the corresponding perimeters on specific layers for each one? Does anyone have any idea how to approach this?
  21. Hello! Is it possible to create this kind of parcele name or Maybe on number. As you can see in the picture attach it symbol / between two numbers. 3/180. Its writen in blue color so you have to look a bit carefully....my mistake Thank you
  22. Yesterday
  23. A couple of comments, the outside stairs use a rectang with a wipeout so it hides the windows behind. Also there is no inside support ? tr I am metric but not sure about 2x4 for rafters at that span, there is no @ what spacing. Ceiling 2 lines or even 3 with insulation shown. Concrete beam arrow did not point to it, and a conc beam should be shown as a "T" This detailing is wrong only show 12' beam not concrete at bottom. Cantilever balcony is shown wrong. see red lines. There is no way a 4' slab can cantilever that far. May need some help on structural layout of beams in slab. Enough from me, its about learning. I am sure others will comment.
  24. Thank you for your feedback. It’s my first time working on this, so I didn’t realize I could upload the DWG file. I’ll share it so it’s easier to review. Thanks again for your time and advice! Drawing1.dwg
  25. Hi, please share the TTT lisp
  26. CyberAngel

    Question About Roof Section Drawing

    Yes, we should see the peak of the roof from one side and the ridge from the other. Unless there's a flat section in the middle.
  27. Then post a .dwg file that we can downloaded and view better. Right off the bat your roof cut section should appear differently in the two sections. Judging by what I can see it's very similar in both sections. This will be my last comment. Good luck on your submission.
  28. Last week
  29. Being a road designer for many years we would always sample wider than needed, as you suggest a small problem when a line ends on a face. Within the plot section you would set left and right limits so this would truncate a section to a fixed width, even though sections are wider. One clean up was we wanted natural surface to be wider than the design so would trim left and right section details to get that effect. Oh yeah the other is we always started a road before the actual start and after the end so could work out the blend correctly.
  1. Load more activity
×
×
  • Create New...