Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

BeKirra
en respuesta a: asherjoh

It looks likely you are not using any ducting add-on.

Theoretically speaking, there are 2 ways to get text/size of throat:

1) Measure the line lengths on an existing duct object then place text that matching what you got;

2) Draw new duct piece then obtain the throat size from your input of the duct.

 

If I understand your question correctly, you are after the 1st option.

Here is an example:

(defun c:DuctThroat (/ ThroatLine1 Ent01 ThroatLine1_1stPt ThroatLine1_2ndPt Throat1
ThroatLine2 Ent02 ThroatLine2_1stPt ThroatLine2_2ndPt Throat2 PlaceText)

(setq ThroatLine1 (car (entsel "\nSelect 1st line: ")))
(setq Ent01 (entget ThroatLine1))
(setq ThroatLine1_1stPt (cdr (assoc 10 Ent01)))
(setq ThroatLine1_2ndPt (cdr (assoc 11 Ent01)))
(setq Throat1 (distance ThroatLine1_1stPt ThroatLine1_2ndPt))

(setq ThroatLine2 (car (entsel "\nSelect 2nd line: ")))
(setq Ent02 (entget ThroatLine1))
(setq ThroatLine2_1stPt (cdr (assoc 10 Ent02)))
(setq ThroatLine2_2ndPt (cdr (assoc 11 Ent02)))
(setq Throat2 (distance ThroatLine2_1stPt ThroatLine2_2ndPt))

(setq PlaceText (getpoint "\nInsert throat size: "))
(command "._text" PlaceText "" "" (strcat (rtos Throat1 2 0) "x" (rtos Throat2 2 0)))

(princ)
); end of defun

 

Note: This code measures lines only, not polylines.

 

HTH

Please mark "Accept as Solution" and "Like" if my reply resolves the issue and it will help when others need helps.
= ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ =
A circle is the locus of a cursor, starting and ending at the same point on a plane in model space or in layout such that its distance from a given coordinates (X,Y) is always constant.
X² + Y² = C²