Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/22/2024 in all areas

  1. This is a little more complicated because I don't know how to make a dynamic block in lisp. But manually it is possible. Steps: Click on a LEVEL-OBJ block with the right-click enter the block editor Select the attribute and in the properties change LOCK POSITION to 'on' Same for multiline Choose the Flip setting by setting a vertical axis from the tip of the arrow. Then in Actions choose the flip action and select your parameter then all the objects (attribute included) Exit the editor saving the changes In the drawing do an ATTSYNC then a REGENALL If done correctly you will be able to reverse your block with the little arrow NB: DIMZIN at 0 is very good for keeping zeros at the beginning and end (oldsnap is not a good choice: OSNAP is another variable, but if you declare it in local variable, is not important)
    1 point
  2. Welcome in the forum, Kvlar! Do you intend to select several lines, and the program to insert blocks in the midpoints? Can you *show* us what do you need? And also the Lisp we are talking about...
    1 point
  3. @Nikon If you want to correlate the precision of the LEVEL-REF block, just change at the line 350 (cons 1 (rtos 0.0 2 2)) -> (cons 1 (rtos 0.0 2 3)) Be carrefull to the value of the DIMZIN variable which can influence the display of leading or trailing zeros.
    1 point
  4. In complex linetypes with text, the rotation field of the text used to have two alternatives, i.e. R=value and A=value. The R= signifies relative rotation to the line direction and A= signifies absolute rotation with respect to the origin. If both fields are not specified, the rotation defaults to R=0. As your linetype definition includes the A=0 field, then all your old drawings should have had all the characters aligned to North. Perhaps you only had horizontal lines where the effect would not be noticed? The U=0 field is not backwards compatible with version 2000 and produces an error, as you have noticed. The R=0 should be compatible with both versions, but the lines would have to be drawn in the correct direction for text to be in a readable alignment. The A=0 field should also be compatible with both versions. I do not have the latest version so I cannot check that.
    1 point
  5. Your list is (setq lst '( ("1NPT" (274.153 159.462 0.0)) ("2NPT" (289.385 162.882 0.0)) ("SP" (296.889 154.795 0.0)) ("4NPT" (270.005 143.501 0.0)) ("8NPT" (293.189 146.368 0.0)) ("9NPT" (312.465 145.292 0.0)) ("5NPT" (282.932 131.402 0.0)) ("12NPT" (272.478 120.102 0.0)) ("11NPT" (255.807 122.674 0.0)) ("10NPT" (236.431 127.388 0.0)) ("3NPT" (244.494 141.269 0.0)) ) ) When you use (mapcar '(lambda (x) ..... ) lst) x becomes each element in the list So for example for the first element x becomes ("1NPT" (274.153 159.462 0.0)) which returns for (car x), we obtain "1NPT" which is the 1st element of the list. with (cdr x) we obtain the list minus the 1st element i.e.((274.153 159.462 0.0)) car and cdr are the basis for list manipulation in lisp. with (car (cdr x)) that we can write (cadr x) we will obtain (274.153 159.462 0.0) with (car (car (cdr x))) that we can write (caadr x) we will therefore obtain 274.153 with (cdr (car (cdr x))) that we can write (cdadr x) we obtain (159.462 0.0) with (car (cdr (car (cdr x)))) that we can write (cadadr x) we obtain 159.462 The writing nesting level can only be done on 4 levels If for example you also wanted the z of the point you would have to do: (car (cdr (cdr (car (cdr x))))) that it would be necessary to write (car (cddadr x)) to obtain 0.0
    1 point
  6. The line (setq lst (mapcar '(lambda ( x ) (list (car x) (rtos (car y))(rtos (cadr y)))) lst)) must be (setq lst (mapcar '(lambda ( x ) (list (car x) (rtos (caadr x))(rtos (cadadr x)))) lst))
    1 point
  7. If only one entity at a time, you can add a Has-Property 'Area check. (while (setq obj (vlax-ename->vla-object (car (entsel "Pick obj for area ")))) (setq a (vlax-get obj 'Area)) (setq lay (vlax-get obj 'layer)) (alert (strcat "The Area is " (rtos a 2 2) " on layer " lay)) )
    1 point
  8. Have no idea why not working had a look at my "W" only difference is it uses1 decimal place, but I am not running 2024. A,20,-5.08,["W",STANDARD,S=1.8,R=0.0,X=-1.8,Y=-0.9],-3 Yes can do Water24 in same lin file, but that is not really the answer to why not working.
    1 point
  9. It's simple just freeze layers rather than turning them off to avoid that issue. Objects on layers that are turned off are not only processed by Zoom Extents but slow down AutoCAD as it has to process more objects than you're actually working on.
    1 point
  10. Can write direct to excel. As you pick text puts value into Excel twice a bit odd request but not a problem. Try this asks for label then text use Enter to exit note need 2 enters to exit totally. ; simple text to Excel ; By AlanH March 2024 (defun c:wow ( / col txt) ;; Thanks to fixo ;; ;; = Set Excel cell text = ;; ;; ;; (defun xlsetcelltext ( row column text) (setq cells (vlax-get-property (vlax-get-property myxl "ActiveSheet") "Cells")) (vl-catch-all-apply 'vlax-put-property (list cells 'Item row column (vlax-make-variant (vl-princ-to-string text) vlax-vbstring))) ) (if (= myxl nil) (setq myxl (vlax-get-object "Excel.Application")) ) (if (= myxl nil) (progn (setq myxl (vlax-get-or-create-object "Excel.Application")) (vla-put-visible myXL :vlax-true) (vlax-put-property myxl 'ScreenUpdating :vlax-true) (vlax-put-property myXL 'DisplayAlerts :vlax-true) (vlax-invoke-method (vlax-get-property myXL 'WorkBooks) 'Add) ) (princ "Excel open") ) (if (= row nil)(setq row 1)) (while (/= (setq txt (getstring "\nEnter new label Press Enter to exit " T)) "") (xlsetcelltext row 1 txt) (setq row (1+ row)) (while (setq txt (entsel "\nPick a text or Enter to exit ")) (setq txt (cdr (assoc 1 (entget (car txt))))) (xlsetcelltext row 1 txt) (setq row (1+ row)) (xlsetcelltext row 1 txt) (setq row (1+ row)) ) ) ; (if (not (vlax-object-released-p myXL))(progn(vlax-release-object myXL)(setq myXL nil))) (princ) )
    1 point
  11. or (vl-filename-base (getvar 'dwgname))
    1 point
  12. Sorry Lee i dont have yet any code on it:lol: perhaps if you teach me how to start Lisp routes( i'm most willing to learn on creating Lisp routes) basically i just only learning on other codes that i got just edit and add by trial and error until it will work, no books or manual to guide im also one of the Lisp route user only,
    1 point
×
×
  • Create New...