Modifying Dimension -3 Attributes

Modifying Dimension -3 Attributes

kpennell
Collaborator Collaborator
944 Views
3 Replies
Message 1 of 4

Modifying Dimension -3 Attributes

kpennell
Collaborator
Collaborator

I'm trying to create a command to toggle off a dimension extension line, based on a users select dim prompt.  But the results are varying in that, sometimes it removes the 'ACAD_DIMASSOC_CALC_DIMLFAC' and the 'ACAD_DIMASSOC_DIMLFAC' and replaces the dimension value if it had a linear scale of 1.  but, it is inconsistent, so now I'm thinking, I'm missing something fundamentally.  Just a note, I thought, if the text had a background text enabled, it would work, but it sometimes does it to those entites as well.  Again, I can't see a trend here:

 

(setq DimEnt (car (entsel)))
(setq oldlist (entget DimEnt))
(if (assoc -3 (entget DimEnt '("ACAD_DIMASSOC_CALC_DIMLFAC")))(setq GetCalcDimLFac (car (cdr (assoc -3 (entget DimEnt '("ACAD_DIMASSOC_CALC_DIMLFAC"))))))(setq GetCalcDimLFac nil))
(if (assoc -3 (entget DimEnt '("ACAD_DIMASSOC_DIMLFAC")))(setq GetDimLFac (car (cdr (assoc -3 (entget DimEnt '("ACAD_DIMASSOC_DIMLFAC"))))))(setq GetDimLFac nil))
(if (assoc -3 (entget DimEnt '("ACAD_DIMASSOC_OVERRIDDEN_DIMLFAC")))(setq GetOvrdeDimLFac (car (cdr (assoc -3 (entget DimEnt '("ACAD_DIMASSOC_OVERRIDDEN_DIMLFAC"))))))(setq GetOvrdeDimLFac nil))
(if (assoc -3 (entget DimEnt '("ACAD")))(setq GetAcad (car (cdr (assoc -3 (entget DimEnt '("ACAD"))))))(setq GetAcad nil))
(setq StartOfAcadList '("ACAD" (1000 . "DSTYLE") (1002 . "{") (1070 . 76) (1070 . 0) (1070 . 75) (1070 . 1)))
;(setq EndOfAcadList (member (cons 1070 40) GetAcad))
(setq EndOfAcadList '((1002 . "}")))
(if (member (cons 1070 69) GetAcad)(setq BGMask (list (nth 0 (member (cons 1070 69) GetAcad)) (nth 1 (member (cons 1070 69) GetAcad))))(setq BGMask nil))
(setq FinalAcadList (append StartOfAcadList BGMask EndOfAcadList))
(if (and (= GetCalcDimLFac nil)(= GetDimLFac nil)(= GetOvrdeDimLFac nil))(setq thedata (list (list -3 FinalAcadList)))(setq thedata (list (list -3 GetCalcDimLFac GetDimLFac GetOvrdeDimLFac FinalAcadList))))
(setq newlist (append oldlist thedata))
(entmod newlist)

 

Any help here would be great.

0 Likes
Accepted solutions (1)
945 Views
3 Replies
Replies (3)
Message 2 of 4

CodeDing
Advisor
Advisor
Accepted solution

@kpennell ,

 

To turn off an extension line, why not just use the (setpropertyvalue ...) method?

;Turn off extension line 1
(setpropertyvalue (car (entsel)) "Dimse1" 1)
;Turn off extension line 2
(setpropertyvalue (car (entsel)) "Dimse2" 1)

 

Best,

~DD

0 Likes
Message 3 of 4

roland.r71
Collaborator
Collaborator

I realy can't make out much from this Wall of Lisp...

But there's one thing that pops out:

 

(setq oldlist (entget DimEnt))

<Wall of Lisp>

(setq newlist (append oldlist thedata))
(entmod newlist)

 

What's supposed to happen there?

oldlist holds a complete entity & then you just 'append' some stuff to it, and try to 'modify' the entity like that?

AFAIK entmod should error out, or return nil.

 

You should replace (substitute) the existing data inside 'oldlist' and 'entmod' that.

 

Modifying an Entity

 

0 Likes
Message 4 of 4

Kent1Cooper
Consultant
Consultant

Since you surely don't always know which end of a Dimension is 1 and which is 2, you may be interested in DimExtLineToggle.lsp with its DET command, available >here<.  It toggles the extension line off if it's on, on if it's off, and you can pick on the Dimension anywhere nearer to the side you want toggled, without knowing which is which -- on the extension line itself [when visible], or the arrowhead, or the dimension line, or the text.

Kent Cooper, AIA
0 Likes