TheSwamp

CAD Forums => CAD General => Topic started by: Big G on August 31, 2014, 07:56:48 PM

Title: add radius into Arc Length Dimension
Post by: Big G on August 31, 2014, 07:56:48 PM
Monday morning headache (maybe i need more coffee!)

The standard Dim->ArcLength  gives the length of the arc.....Does anyone know of a way to add in another field below it to add the Radius of said arc, so as to avoid lengthy tables of setouts and double dimensioning.....

|  14250 |   - Length
     R20        - Radius Field (field to keep it dynamically updated)

Cheers

Title: Re: add radius into Arc Length Dimension
Post by: ChrisCarlson on September 02, 2014, 08:25:49 AM
Under insert field and select object, simply select arc radius?

(http://i59.tinypic.com/28qj4p.jpg)
Title: Re: add radius into Arc Length Dimension
Post by: Big G on September 04, 2014, 12:52:12 AM
Close ... no cigars today though - Its contained within an xref so i cant pick the individual entity (the arc)

Appreciate the input tho....

G

Title: Re: add radius into Arc Length Dimension
Post by: Bethrine on September 04, 2014, 10:15:15 AM
How about this?
Title: Re: add radius into Arc Length Dimension
Post by: ronjonp on September 04, 2014, 11:29:55 AM
Close ... no cigars today though - Its contained within an xref so i cant pick the individual entity (the arc)

Appreciate the input tho....

G

Label it within the xref ?
Title: Re: add radius into Arc Length Dimension
Post by: ChrisCarlson on September 05, 2014, 11:03:17 AM
Close ... no cigars today though - Its contained within an xref so i cant pick the individual entity (the arc)

Appreciate the input tho....

G

If you can't select the entity can you simply trace, select and delete the trace?
Title: Re: add radius into Arc Length Dimension
Post by: alanjt on September 05, 2014, 03:06:55 PM
Down and dirty...

Code: [Select]
(defun c:TEst (/ _massoc obj dic arc)

  (defun _massoc (x lst)
    (if lst
      (if (eq (caar lst) x)
        (cons (car lst) (_massoc x (cdr lst)))
        (_massoc x (cdr lst))
      )
    )
  )

  (setq obj (entlast))

  (command "_.dimarc")
  (while (eq (logand 1 (getvar 'CMDACTIVE)) 1) (command PAUSE))

  (if (and (not (equal obj (setq obj (entlast))))
           (eq (vla-get-HasExtensionDictionary (setq obj (vlax-ename->vla-object obj))) :vlax-true)
           (setq dic (vla-getExtensionDictionary obj)
                 arc (vlax-ename->vla-object
                       (cdar (vl-remove-if-not
                               (function (lambda (x) (member (cdr (assoc 0 (entget (cdr x)))) '("ARC" "LWPOLYLINE"))))
                               (_massoc 331 (entget (vlax-vla-object->ename (vla-getobject dic "ACAD_DIMASSOC"))))
                             )
                       )
                     )
           )
      )

    (vla-put-textoverride
      obj
      (strcat "L= <>\\PR= %<\\AcObjProp Object(%<\\_ObjId "
              (if (vl-string-search "64" (getenv "PROCESSOR_ARCHITECTURE"))
                (vla-getobjectidstring
                  (vla-get-utility (vla-get-activedocument (vlax-get-acad-object)))
                  arc
                  :vlax-false
                )
                (itoa (vla-get-objectid arc))
              )
              ">%).Radius \\f \"%lu2\">%"
      )
    )
  )

  (princ)
)
(vl-load-com)
(princ)