Author Topic: Z Dimensions question  (Read 506 times)

0 Members and 1 Guest are viewing this topic.

Offline cadbyken

  • Premier Member
  • *****
  • Posts: 4792
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #15 on: Feb 14, 2018, 03:56:14 PM »
something like

Code: [Select]
(setq DIM (entsel) "L" "")
(command "dimedit" "n" (strcat DIF quote dash greater) DIM)

Didn't test it but that is how I would approach it.

Note that it looks like you will need to make the ascii characters for
quote
dash
greater than symbol and combine them together.

« Last Edit: Feb 14, 2018, 03:58:18 PM by cadbyken »
Ken Taylor - (Limbach Eng & Design Services, LEDS)
Have you seen any good youtube videos <--- lately? ;)
AutoCAD MEP V16, Fabrication 2016/17/18...Dell Precision 7710 i7-2.70 GHz/32 GB RAM

Offline VirtualPilotTopic starter

  • Premier Member
  • *****
  • Posts: 6392
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #16 on: Feb 14, 2018, 04:39:56 PM »
That might be why I can't get it to work, is getting confused by the " and > thinking they are commands...
 I can't believe that I solve what I need but can't get the simple task of adding the text I want at the end of the number  ;D
Santos Cedeno
CAD/BIM Mgr - DIXIE Metal Products
Adesk Design Suite 2016 - FAB CAD - FAB CAM - FAB EST / SP 4
DELL T-5810 Intel Xeon 3.50Mhz - 16Gig RAM - 4Gig AMD FirePro 5100 - W10/64 - 1T HD

Offline cadbob

  • Premier Member
  • *****
  • Posts: 2449
  • Country: us
  • Gender: Male
    • Sheet Metal Workers International
Re: Z Dimensions question
« Reply #17 on: Feb 14, 2018, 07:58:48 PM »
If I remember, there was a way to Lisp in a Dialog Control Box (DCL) so you could type in your UP or Down. It was so long ago when I used to write code I remember doing it barely. (20yrs)

I could be wrong someone feel free to correct me
If you are going to fly by the seat of your pants, expect friction burns!
Adopt, Adapt, Overcome or be overcome!!!

Offline cadbyken

  • Premier Member
  • *****
  • Posts: 4792
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #18 on: Feb 14, 2018, 08:05:43 PM »
Bob it could be done through a prompt as well.
Ken Taylor - (Limbach Eng & Design Services, LEDS)
Have you seen any good youtube videos <--- lately? ;)
AutoCAD MEP V16, Fabrication 2016/17/18...Dell Precision 7710 i7-2.70 GHz/32 GB RAM

Offline cadbob

  • Premier Member
  • *****
  • Posts: 2449
  • Country: us
  • Gender: Male
    • Sheet Metal Workers International
Re: Z Dimensions question
« Reply #19 on: Feb 14, 2018, 08:13:37 PM »
Yup true Ken, not thinking clearly here Flu!  :-[
If you are going to fly by the seat of your pants, expect friction burns!
Adopt, Adapt, Overcome or be overcome!!!

Offline VirtualPilotTopic starter

  • Premier Member
  • *****
  • Posts: 6392
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #20 on: Feb 15, 2018, 12:35:37 PM »
Here is the final code guys, thank all for the help, now works like a charm, run and 3 clicks you're done...

Might be useful for others here....

Code: [Select]
(defun c:ZDIF (/ pt1 pt2 z1 z2 dif edim txt)
(setq txt "\" UP ->")
(setq pt1 (getpoint "\nDUCT 1 NODE: "))
(setq pt2 (getpoint "\nDUCT 2 NODE: "))
(setq z1 (caddr pt1))
(setq z2 (caddr pt2))
(setq dif (- z2 z1))
(setq dif (rtos dif 5 0))
(setq dif (strcat dif txt))
(vl-load-com)
(setq edim (vlax-ename->vla-object (car (entsel "\Select dimension"))) )
(vla-put-TextOverride edim dif )
(princ)
)
Santos Cedeno
CAD/BIM Mgr - DIXIE Metal Products
Adesk Design Suite 2016 - FAB CAD - FAB CAM - FAB EST / SP 4
DELL T-5810 Intel Xeon 3.50Mhz - 16Gig RAM - 4Gig AMD FirePro 5100 - W10/64 - 1T HD

Offline VirtualPilotTopic starter

  • Premier Member
  • *****
  • Posts: 6392
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #21 on: Feb 15, 2018, 12:38:30 PM »
For those that are experts at LISP, they could alter the code so that if the second point selected is (+) then print "UP ->" and if it is (-) then print "DN ->"

But this thing is already giving me a headache as it is, so I will copy it and rename it for those cases going down LOL

Santos Cedeno
CAD/BIM Mgr - DIXIE Metal Products
Adesk Design Suite 2016 - FAB CAD - FAB CAM - FAB EST / SP 4
DELL T-5810 Intel Xeon 3.50Mhz - 16Gig RAM - 4Gig AMD FirePro 5100 - W10/64 - 1T HD

Offline cadbyken

  • Premier Member
  • *****
  • Posts: 4792
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #22 on: Feb 15, 2018, 01:33:38 PM »
 8) Very nice. 

Wasn't sure the second line was going to work though with the extra quote.  What does that do?
Ken Taylor - (Limbach Eng & Design Services, LEDS)
Have you seen any good youtube videos <--- lately? ;)
AutoCAD MEP V16, Fabrication 2016/17/18...Dell Precision 7710 i7-2.70 GHz/32 GB RAM

Offline VirtualPilotTopic starter

  • Premier Member
  • *****
  • Posts: 6392
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #23 on: Feb 15, 2018, 02:31:37 PM »
8) Very nice. 

Wasn't sure the second line was going to work though with the extra quote.  What does that do?

Extra quote? Hmmmm I guess I can delete it and see if still works, I though it was needed!  ;D

EDIT: low and behold, you're right LOL, works without it  ;)

EDITEDIT: talked too soon LOL, started a new drawing and it does not work without the quote, has to be there...
« Last Edit: Feb 15, 2018, 02:34:48 PM by VirtualPilot »
Santos Cedeno
CAD/BIM Mgr - DIXIE Metal Products
Adesk Design Suite 2016 - FAB CAD - FAB CAM - FAB EST / SP 4
DELL T-5810 Intel Xeon 3.50Mhz - 16Gig RAM - 4Gig AMD FirePro 5100 - W10/64 - 1T HD