Copy/Paste Dimension Length to Another - LISP

Copy/Paste Dimension Length to Another - LISP

JohnC_ISM
Collaborator Collaborator
1,824 Views
9 Replies
Message 1 of 10

Copy/Paste Dimension Length to Another - LISP

JohnC_ISM
Collaborator
Collaborator

so im looking to get a LISP that will take the info from one dimension and copy and paste into another dimension. 

 

for instance on paper you cant see how far a fence is from a property line so we exaggerate the distance and just override the actual dimension. in the picture youll see the point shows the fence is 0.3' from the line but we move it and then change the new dimension to match the old, for visual purposes. 

 

 

 

0 Likes
Accepted solutions (1)
1,825 Views
9 Replies
Replies (9)
Message 2 of 10

devitg
Advisor
Advisor

Hi   @JohnC_ISM  For better understanding, and maybe get further help, please upload such sample.dwg
As far as I know, ACAD only can edit DWG.

0 Likes
Message 3 of 10

Kent1Cooper
Consultant
Consultant

That would involve selecting the "true" Dimension and pulling its measured value [which will be a real number], converting that to a text string, and imposing that as a text override on the selected "fake" Dimension.  It shouldn't be hard to write a routine to do that, but does it correctly describe what you want to do?

Kent Cooper, AIA
0 Likes
Message 4 of 10

pbejse
Mentor
Mentor

This is classic @devitg  

pbejse_1-1613493494810.png

beer.gif

 

Monthly Stats

  • 02-16-2021 07:47 AM
  • 02-14-2021 05:52 PM
  • 02-14-2021 05:49 PM
  • 02-12-2021 11:23 AM
  • 02-03-2021 10:12 AM

twice in one day

Message 5 of 10

Kent1Cooper
Consultant
Consultant
Accepted solution

@Kent1Cooper wrote:

....  It shouldn't be hard to write a routine to do that, but does it correctly describe what you want to do?


If yes, try something like this [in simplest terms, minimally tested]:

 

(defun C:DTT ; = Dimension Text Transfer
  (/ d1 d2 ddata)
  (if
    (and
      (setq d1 (car (entsel "\nSelect true Dimension to get actual measurement from: ")))
      (setq d2 (car (entsel "\nSelect exaggerated Dimension to impose text override: ")))
    ); and
    (progn ; then
      (setq ddata (entget d2))
      (entmod
        (subst
          (cons 1 (strcat (rtos (cdr (assoc 42 (entget d1))) 2 1) "'"))
            ; "true" Dimension's measured value as text with ' suffix
          (assoc 1 ddata); "fake" Dimension's text entry
          ddata
        ); subst
      ); entmod
    ); progn
  ); if
  (princ)
); defun

 

That's particular to your images -- decimal number, one decimal place, foot-mark suffix.  If you need it under different formats, it could be made to find such variables from the Dimension Style definition and use them instead.  It could also be made to verify you picked the right kinds of things, ask again if you miss, etc.

Kent Cooper, AIA
0 Likes
Message 6 of 10

devitg
Advisor
Advisor

@pbejse  I  ever image when some one send  to a Dr Medical office a picture , and do not go himself. 

Why are so original poster  [OP] are so reluctant to show the dwg where they want to do something.?

 

And most often the OP ask"" WOULD YOU PLEASE ADD IT AND SO? " after the first correct answer from the helpers at this forum. 

 

And I marvel how so much helpers  can guess the answer to the OP  , with out such data. 

 

I often think how a tailor could ever do a suit to the person suit dress, if the user do not meet the tailor.

 

And in a brute an rude way . 

"no  dead body, no coffin"   

Hope you apologize me for post my CLASSIC . 

 

 

 

 

 

 

Message 7 of 10

pbejse
Mentor
Mentor

@devitg wrote:

@pbejse  I  ever image when some one send  to a Dr Medical office a picture ,

....Hope you apologize me for post my CLASSIC . 


 

Dont get me wrong @devitg.  From the doc to the tailor and up to the db's analogy.

I'm totally loving it 😊, paste that template of yours and post away kind sir

 

EDIT:  kudos to you for being a good sport.

Message 8 of 10

JohnC_ISM
Collaborator
Collaborator

i think thats exactly what i was looking to do. i just tried your lisp and it says "DDT nil" 

0 Likes
Message 9 of 10

Kent1Cooper
Consultant
Consultant

@JohnC_ISM wrote:

.... i just tried your lisp and it says "DDT nil" 


[You do need to spell the command name correctly....]

Kent Cooper, AIA
0 Likes
Message 10 of 10

JohnC_ISM
Collaborator
Collaborator

wow i feel so stupid hahah yes works perfectly. thank you so much

0 Likes