I swear to got I tried that!!! Musta not been squinting just right.
Thanks Lee.
Tried to combine this piece of code with another piece of code so they run from the same Defun.
It all works but I'm getting this as a return result.
Segment Length: 272.0000
Dimscale is correct: 8.0000
Segment Length: 272.0000
Dimscale is correct: 8.0000
Segment Length: 272.0000
Dimscale is correct: 8.0000
Segment Length: 272.0000
Dimscale is correct: 8.0000
Segment Length: 272.0000
Dimscale is correct: 8.0000
Segment Length: 272.0000
Dimscale is correct: 8.0000
Segment Length: 272.0000
Dimscale is correct: 8.0000
Segment Length: 272.0000
Dimscale is correct: 8.0000
Segment Length: 272.0000
Dimscale is correct: 8.0000
Segment Length: 272.0000
Dimscale is correct: 8.0000
Error: Function cancelledSpecify height of text or [Annotative] : *Cancel*
Unless I escape, it could run for days. But you get the idea.
- ;;; Sets dimscale based on length of Bottom or Top white border line.
- ;;; TB_DIM at command line
- ;;; ---------------------------------------------------------------------------------
- ;;; Created 07/05/22 by Jerry Logan
- ;;; Assist from MHupp/Lee Mac in The Swamp
- ;;; Routine selects bottom white border line, checks it's length and sets
- ;;; Dimscale equal to that length by dividing bottom line by 34.
- ;;; Refer to OneNote - Drawing Conversion Help folder "Conversion Help" page
- ;;; DIMSCALE/BORDER SIZE CHART for correct dimscales.
- ;;; ---------------------------------------------------------------------------------
-
- (defun tb_dim ( / box dimsc idx mni mxa obj scl sel )
- (if (setq sel (ssget "_C" '(1 1) '(-1 -1)))
- (progn
- (setq dimsc (getvar 'dimscale)
- obj (vlax-ename->vla-object (ssname sel 0))
- )
- (vla-getboundingbox obj 'mni 'mxa)
- (setq box (mapcar '- (vlax-safearray->list mxa) (vlax-safearray->list mni))
- scl (/ (car box) 34.0)
- )
- (prompt (strcat "\nSegment Length: " (rtos (car box) 2 4)))
- (if (equal scl dimsc 1e-4)
- (prompt (strcat "\nDimscale is correct: " (rtos dimsc 2 4)))
- (progn
- (prompt (strcat "\nDimscale changing from [" (rtos dimsc 2 4) "] to " (rtos scl 2 4)))
- (setvar 'dimscale scl)
- )
- )
- )
- (prompt "\nNothing selected, try again.")
- )
- (princ)
- )
- (vl-load-com) (princ)
-
- ;;; -----------------------------------------------------
-
- (defun Sctxt ( / dimsc )
- (setq dimsc (getvar "dimscale"))
-
- (setvar "CMDECHO" 0)
- (setvar "BLIPMODE" 0)
-
- (command ".style" "Standard" "ipco.shx" (* 1.000 dimsc) "0.85" "0" "n" "n" "n")
- (command ".style" "L080" "ipco.shx" (* 0.0781 dimsc) "0.85" "0" "n" "n" "n")
- (command ".style" "L100" "ipco.shx" (* 0.0938 dimsc) "0.85" "0" "n" "n" "n")
- (command ".style" "L120" "ipco.shx" (* 0.1094 dimsc) "0.85" "0" "n" "n" "n")
- (command ".style" "L140" "ipco.shx" (* 0.1406 dimsc) "0.85" "0" "n" "n" "n")
- (command ".style" "L175" "ipco.shx" (* 0.1563 dimsc) "0.85" "0" "n" "n" "n")
- (command ".style" "L200" "ipco.shx" (* 0.1719 dimsc) "0.85" "0" "n" "n" "n")
- (command ".style" "L240" "ipco.shx" (* 0.2187 dimsc) "0.85" "0" "n" "n" "n")
- (command ".style" "LS080" "ipco.shx" (* 0.0781 dimsc) "0.85" "20" "n" "n" "n")
- (command ".style" "LS100" "ipco.shx" (* 0.0938 dimsc) "0.85" "20" "n" "n" "n")
- (command ".style" "LS120" "ipco.shx" (* 0.1094 dimsc) "0.85" "20" "n" "n" "n")
- (command ".style" "LS140" "ipco.shx" (* 0.1406 dimsc) "0.85" "20" "n" "n" "n")
- (command ".style" "LS175" "ipco.shx" (* 0.1563 dimsc) "0.85" "20" "n" "n" "n")
- (command ".style" "LS200" "ipco.shx" (* 0.1719 dimsc) "0.85" "20" "n" "n" "n")
- (command ".style" "LS240" "ipco.shx" (* 0.2187 dimsc) "0.85" "20" "n" "n" "n")
- (princ)
- )
-
- (defun c:Txt_Dim ()
- (while
- (tb_dim)
- (sctxt)
- )
- )
-
-
-
|