Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/29/2022 in all areas

  1. more than one way to do anything, above is neater, this is another (useful if you want to change any other properties of the selection) (setq set1 (ssget "_C" p1 p2)) (setq acount 0) (while (< acount (sslength set1)) (setq MyEntList (entget (ssname set1 acount))) (entmod (subst (cons 8 "0") (assoc 8 MyEntList) MyEntList)) (entupd (ssname set1 acount)) (setq acount (+ acount 1)) (princ MyEnt) )
    2 points
  2. @Scoutr4 You don't need to irradiate thought the selection set you just reference it to change them all at the same time. (defun c:example (/ ss) (if (setq set1 (ssget "_C" p1 p2)) (command "_.CHPROP" set1 "" "_LAyer" "0" "")) (prompt "\nNothing Selected") ) )
    2 points
  3. Hi guys, As thanks for helping me out through the journey of AutoLISP from multiple posts, I've decided to make a small contribution to CADTutor.net with my own code that you can download from here: https://www.cadtutor.net/forum/files/file/27-block-overkill/ Upon issuing the BOVERKILL command, This LISP will allow you to either delete blocks that area "duplicated" on top of one another, or move them to a specified layer. This LISP deletes blocks in which the blocks in comparison abides to the following three criteria below: It shares the same insertion point to a specified tolerance It shares the same effective name It shares the same effective scale to the same specified tolerance Modes of Overkill Thanks to a wonderful suggestion from one of the insights in this forum, the program has been further upgraded as of 20 April 2023. This LISP routine now also allows for three modes of overkill: Distance Plane-Axis Axes The "Distance" mode is the default mode and is the most widely used mode of overkill. This mode determines that two blocks are considered duplicates if the distance between them is within the specified tolerance inputted by the user. The "Plane-Axis" mode determines that two blocks are duplicates if the proximity of the blocks in comparison lies within one tolerance specified for one of the planes , and a separate tolerance along the third axis (normal) of that plane. Calculations are done to the UCS. The "Axes" mode determines that two blocks are duplicates by comparing three different tolerances across each axis individually. All three tolerances must be met for the program to consider the blocks a duplicate. Just like the previous mode, the UCS will be used by the program to perform the calculations. Following this, the program will also draw a circle (of a radius set within the LISP routine) on the insertion points of the processed blocks. These circles will be drawn in the "BOVERKILL-Duplicates" layer. After which it prints a report of the quantity of the deleted or modified blocks to the command line. This feature makes it easy for users to identify where duplicates are found on a large drawing with thousands of blocks. However, the dynamic properties of the block are far too hard for me to calculate as they have different position, rotation and visibility parameters that could be altered by the user. As such, they are ignored. Note that the rotation of the block does not fall in the criteria above as mirroring the block alters it's rotation values, and thus will fail on some circumstances. This means that the blocks will still be processed if as long as the three criteria above satisfy and objects are not rotated the same way. This LISP was inspired when using block counting routines (for example from Lee Mac's Block Counter routine or your own custom routines) reporting incorrect numbers due to duplicate blocks. The OVERKILL command for one reason or another is not able to delete duplicate dynamic blocks that are (for example, rotated normally then rotate through dynamic rotation to the original position). I've also cycled through the net for solutions to no avail. Thus, I opened this program for you folks to use. It's not a perfect code but I hope it will make working for you much more convenient. Any feedbacks, comments, and criticisms are welcomed as I look to learn and get better. Enjoy. Thanks, Jonathan Handojo
    1 point
  4. I think I have seen people using progress bars, although I'd like to know how to use them myself. I've seen your progress in lisp and you do much better things than when you started posting. You have helped me many times. Thanks
    1 point
  5. 100% dealing with small selection sets is always negligible. when selection sets get bigger the differences balloons out of control. and people are usually impatient when it comes to commands thinking everything is instant. I made a command that took a 30+ min process down to sub 30 sec and the person using it thought it didn't work because it was taking too long and would canceled the command and then do it the manual 30+ min way. and why not if their isn't a progress output how long are you suppose to wait? This is an example of why doing the same task with different code. And was really impressed with my code until i saw the rest of the results. https://www.cadtutor.net/forum/topic/74035-copy-multiple-text-contents-to-nearest-text-multiples/
    1 point
  6. It is fractions of a second each way which in a working day you can loose chatting to someone at the coffee machine - if it works, then it works and I reckon that shows you have gone the 'right' way whatever that was.
    1 point
  7. Yes their is no "wrong" way to do things if it works. But it usually boils down to people arguing over if its the most efficient.
    1 point
  8. Excellent. Thank you very much.
    1 point
  9. Command CCL, for Change Color Layouts. I commented out the command that sets the active layout. Put it back if you really want. The main thing is entmod (modify entities by adding or changing the data group). Obviously don't take my layoutlist function. ;; dummy function just for my simple test. You have your own (defun layoutlist ( / ) (list "Layout1" "Layout2" "Layout3" ) ) (defun c:ccl ( / tab i clr ent col) (setq col 7) ;; destination color (foreach tab (layoutlist) ;; you don't need to set the layout active. You can if you really want ;; (setvar 'CTAB tab) (if (setq clr (ssget "X" (list (cons 62 250) (cons 410 tab)) )) (progn (setq i 0) (repeat (sslength clr) (setq ent (ssname clr i)) ;; modify color (if (assoc 62 (entget ent)) (entmod (subst (cons 62 col) (assoc 62 (entget ent)) (entget ent) )) ;; substitute color (entmod (append (entget ent) (list (cons 62 col) ) )) ;; add color ) (setq i (+ i 1)) ) )) ) )
    1 point
  10. Like this? (defun c:example () (setq x (ssget '((0 . "LINE,LWPOLYLINE,INSERT,ARC")))) (repeat (setq y (sslength x)) (setq ss (ssname x (setq y (1- y)))) (command "_.CHANGE" ss "" "_Properties" "_LAyer" "0" "")) )
    1 point
  11. Here is another one - author is me : Marko Ribar... Iterative version - maybe better with exhaustive lists : (defun unique ( l / a ll ) (while (setq a (car l)) (if (vl-some (function (lambda ( x ) (equal x a 1e-6))) (cdr l)) (setq ll (cons a ll) l (vl-remove-if (function (lambda ( x ) (equal x a 1e-6))) (cdr l))) (setq ll (cons a ll) l (cdr l)) ) ) (reverse ll) )
    1 point
  12. I have found this for Firefox. :root { --container--width: 2000px; }
    1 point
  13. Change how you see fit (setq pt (vla-intersectwith (vlax-ename->vla-Object ent1) (vlax-ename->vla-Object ent2) acextendnone)) ;change option here (setq pt (vlax-safearray->List (vlax-variant-vaLue pt))) current acextendnone - Do not extend entity's other options acextendthisentity - Extend ent1 to meet ent2 acextendotherentity - Extend ent2 to meet ent1 acextendboth - Extend both entity's
    1 point
  14. Another way (command "line" (while (< 0 (getvar 'CMDACTIVE)) (command pause)) )
    1 point
  15. Unfortunately, it's not quite as simple as just changing the width on that container. The CSS does not contain media queries for breakpoints beyond the current maximum column width. Consequently, the layout may break at wider column widths, requiring a significant amount of work beyond simply making the column wider. It would also result in wider content areas with longer lines of text, which are generally more difficult to read. I'm not ruling out further theme options in the future, and certainly, if there is support for such a change from the wider CADTutor community, I'd be happy to consider this for a future update.
    1 point
×
×
  • Create New...