Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/06/2025 in all areas

  1. Also, if the "MTEXT" is, you can select all desired "MTEXT" and from "PROPERTIES" tab, select "Text frame". That is the easiest way to do and make a boundary around text. If the "TEXT" is, you can use a built-in function in CAD "TXT2MTXT", select all "TEXT" entities and convert it in "MTEXT" and than add a frame.
    2 points
  2. A possible easy fix try this (setvar 'dimzin 2) at start of code. : (setq num 20) 20 : (rtos num 2 2) "20.00" : (setq num 12.5) 12.5 : (rtos num 2 2) "12.50" : (setq num 12.345) 12.345 : (rtos num 2 2) "12.35" Some extra hints ;; Set the text height for the Title, Header and Data rows (vla-SetTextHeight custObj acDataRow txtht) (vla-SetTextHeight custObj acHeaderRow (* txtht 1.2)) (vla-SetTextHeight custObj acTitleRow (* txtht 1.5)) ; Set the alignment for the Data, Header, and Title rows (vla-SetAlignment custObj (+ acDataRow acHeaderRow acTitleRow) acMiddleCenter) (vla-SetTextStyle custObj (+ acDataRow acHeaderRow acTitleRow) "Arial")
    1 point
  3. Adjust precision? Do you mean add decimals?
    1 point
  4. You can find these errors with the Visual Lisp debugger. Don't you use it?
    1 point
  5. There is some other parentheses misplaced in the 'circle->polygon' function. (defun circle->polygon (cen rad / i N ang x y ptlst) (setq N 36 i 0 ptlst '() ) (while (< i N) (setq ang (* 2.0 pi (/ i (float N))) x (+ (car cen) (* rad (cos ang))) y (+ (cadr cen) (* rad (sin ang))) ) (setq ptlst (append ptlst (list (list x y)))) (setq i (1+ i)) ) (setq ptlst (append ptlst (list (car ptlst)))) ptlst )
    1 point
  6. @leonucadomi Copy the code again. Something has changed. Check if it works. The accuracy should be adjustable with some system variable. When I get home I'll take a look
    1 point
  7. I think you have an extra parenthesis after '... (* rad (without ang))))' There should be 3 parentheses, not 4
    1 point
  8. You appear to have a list of all the values so do one row at a time column C would be for a row (- ( Nth (1+ x) lst) (nth x lst)). Note need to do for one less than the length of list as the last entry will error as there is no dummy value past the last item in the list. Then do last row. I tend to use Insertrows in a table much easier as you just read each line of the list and add a row. Can read excel direct if you want. (vla-insertrows objtable numrows (vla-GetRowHeight objtable (1- numrows)) 1)
    1 point
  9. And also some system variables
    1 point
  10. Something simpler You may need to customize the offset (defun c:agrupaDIMs (/ n conj ent lstent pt pt1 pt2 ptIni ptFin desplz desplzX desplzY punto) (setq n 0) (if (setq conj (ssget '((0 . "DIMEN*")))) (while (setq ent (ssname conj n)) (setq pt1 (cdr (assoc 13 (setq lstent (entget ent)))) pt2 (cdr (assoc 14 lstent)) desplz (distance pt2 (cdr (assoc 10 lstent))) desplzX (- (car (cdr (assoc 10 lstent))) (car pt2)) desplzY (- (cadr (cdr (assoc 10 lstent))) (cadr pt2)) ) (if (< (car pt2) (car pt1)) (setq pt pt1 pt1 pt2 pt2 pt) (if (= (car pt2) (car pt1)) () ) ) (if ptIni (if (< (car pt1) (car ptIni)) (setq ptIni pt1) ) (setq ptIni pt1) ) (if ptFin (if (> (car pt2) (car ptFin)) (setq ptFin pt2) ) (setq ptFin pt2) ) (setq n (+ n 1)) ) ) (setq punto (polar ptIni (angle ptIni ptFin) (/ (distance ptIni ptFin) 2.0)) punto (list (+ (* desplzX 2.5) (car punto)) (+ (* desplzY 2.5) (cadr punto))) ) (command "_dimaligned" ptIni ptFin punto) (princ) )
    1 point
  11. My test and it worked. (setq ss1 (ssget '((0 . "*TEXT")(8 . "0")))) (repeat (setq i (sslength ss1)) (setq PT (cdr (assoc 10 (entget (ssname ss1 (setq i (1- i))))))) (command "bpoly" PT "") )
    1 point
  12. In any case: if you use the 'boundary' command and there is no defined boundary around it, it is possible that 'boundary' will take forever and you will get the feeling that it is the code that is failing. But no: your code is FINE
    1 point
  13. Hi I assume the numbers you are talking about are 'TEXT' objects. If this is the case, you need to add a filter to 'ssget' Replace '((8 . "Lot Layer")) ' with '((0 . " TEXT") (8 . "Lot Layer")) '
    1 point
  14. Thanks rlx this one sort of works for me. It only works if you have minimised the window. (vla-put-windowstate excelApp acMax) Also running dual screens. Need a Powershell script. ie winodws OS level. Ok found something now have to remember how to incorporate into a Powershell script and run from CAD, have done it before. $wshell = New-Object -ComObject wscript.shell $wshell.AppActivate('Excel') If you want to try, go bottom right in windows type cmd then powershell paste the 2 lines. Have an Excel open.
    1 point
×
×
  • Create New...