TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: lqh610 on May 25, 2010, 05:42:19 PM

Title: need some help to play with "Dim"
Post by: lqh610 on May 25, 2010, 05:42:19 PM
hi all, i need a lisp.Cant explain by E . So pls see dwg below
Title: Re: need some help to play with "Dim"
Post by: Lee Mac on May 25, 2010, 06:07:40 PM
hi all, i need a lisp.Cant explain by E . So pls see dwg below

What, you think this is a LISP supermarket?
Title: Re: need some help to play with "Dim"
Post by: ronjonp on May 25, 2010, 06:20:55 PM
Looks like QDIM.
Title: Re: need some help to play with "Dim"
Post by: David Hall on May 25, 2010, 06:24:16 PM
hi all, i need a lisp.Cant explain by E . So pls see dwg below

What, you think this is a LISP supermarket?
:-D :-D :-D :-D :evil:
Title: Re: need some help to play with "Dim"
Post by: gile on May 26, 2010, 02:17:47 AM
Quote
What, you think this is a LISP supermarket?

No, in a supermarket, you're supposed to pay for what you get...
Title: Re: need some help to play with "Dim"
Post by: Kerry on May 26, 2010, 04:43:56 AM

Perhaps his lack of English precludes the refinement to make the request for help more acceptable.

lqh610,
Can you explain what you need help with ??
Title: Re: need some help to play with "Dim"
Post by: Kerry on May 26, 2010, 05:00:31 AM

I see that your drawing explains your wishes quite well.

I believe the TAB key option is not required .. seperate commands would be more efficient and more economical to produce.

Are you using AC2004 ??


The continue can be achieved simply ;

Command: DIM
Dim: continue
Specify a second extension line origin or [Select] <Select>: s
Select continued dimension:
Specify a second extension line origin or [Select] <Select>:
Enter dimension text <48.12>:

Dim: *Cancel*

The remainder would require some simple code to do the job.
Title: Re: need some help to play with "Dim"
Post by: Kerry on May 26, 2010, 05:26:58 AM


This will change the leg length manually ... pretty easy :)

See the attached Picture
Title: Re: need some help to play with "Dim"
Post by: Kerry on May 26, 2010, 05:31:20 AM

for the second Item in your wish list;

You'll need to program so that ;

You select the dimension to divide.
Select the NEW location for the additional extension Line.
Add 2 dimensions programmatically using information extracted from the selected dimension
Title: Re: need some help to play with "Dim"
Post by: Kerry on May 27, 2010, 11:44:10 PM
I thought this was worth coding for our own use, SO ....

Have a play with this.

Code: [Select]
(defun c:Split_Dims (/ sel newpt ent edata elist)

;; codehimbelonga KerryBrown@theSwamp 2010.05.28

  (if (and (setq sel (entsel "\nSelect Dimension to Split."))
           (setq newpt (getpoint "\Select new Dim Point"))
      )
    (progn (setq ent   (car sel)
                 edata (entget ent)
                 elist (vl-remove-if
                         '(lambda (pair)
                            (member (car pair)
                                    (list -1 2 5 102 310 300 330 331 340 350 360 410)
                            )
                          )
                         edata
                       )
           )
           (entmod (subst (cons 14 newpt) (assoc 14 elist) edata))
           (entmakex (subst (cons 13 newpt) (assoc 13 elist) elist))
    )
  )
  (princ)
)

Code added:
Title: Re: need some help to play with "Dim"
Post by: Kerry on May 27, 2010, 11:47:08 PM

... and a piccy to show it in action ..

Title: Re: need some help to play with "Dim"
Post by: Kerry on May 28, 2010, 12:24:02 AM


and try this for the LegLength Modification

Code: [Select]
(defun c:LegLengthMod ( / ss dimobjs)

;; codehimbelonga KerryBrown@theSwamp 2010.05.28

  (vl-load-com)
  (if (and (setq ss (ssget '((0 . "DIMENSION"))))
           (setq dimobjs (mapcar 'vlax-ename->vla-object
                                 (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
                         )
           )
      )
    (foreach dim dimobjs
      (vla-put-extlinefixedlensuppress dim :vlax-true)
      (vla-put-extlinefixedlen dim (* 2 (vla-get-textheight dim)))
    )
  )
  (princ)
)

Title: Re: need some help to play with "Dim"
Post by: Kerry on May 29, 2010, 08:31:43 PM

lqh610 ,
were you able to understand the code and use it ??
Title: Re: need some help to play with "Dim"
Post by: Kerry on May 31, 2010, 05:57:21 AM

I really DO enjoy talking to myself  :-P
Title: Re: need some help to play with "Dim"
Post by: Lee Mac on May 31, 2010, 06:52:54 AM
I thought this might happen...