Author Topic: Z Dimensions question  (Read 507 times)

0 Members and 1 Guest are viewing this topic.

Offline VirtualPilotTopic starter

  • Premier Member
  • *****
  • Posts: 6392
  • Country: us
  • Gender: Male
Z Dimensions question
« on: Feb 09, 2018, 02:43:44 PM »
Is there an easy way, such like with the DIM command to add a Elevation difference by picking two ducts nodes?

No CTEXT as I want the extensions and arrows to show like a normal dimension... but if there is nothing available then CTEXT might be an answer...

See pic...
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 #1 on: Feb 09, 2018, 02:54:00 PM »
Actually, scratch CTEXT, it doesn't work for what I'm trying to achieve...  :-\
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 #2 on: Feb 09, 2018, 09:07:17 PM »
Alright, even googling this, no one in the country is even doing this and seems AutoCAD cannot do it with commands, so... for the time being my interim solution (or permanent) is to use CTEXT on each duct as CTEXT cannot do calculations from two pieces of ducts...so here it is for now...  :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 APD-DB

  • Full Member
  • ***
  • Posts: 51
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #3 on: Feb 09, 2018, 10:55:04 PM »
Don’t know if this helps but if you draw line in plan view and snap to 2 different nodes at different elevations you can dataextract the delta. I am not a lisp writer but I imagine you can pull out that information somehow.  Hope it helps.
Is your computer on?

Advanced Piping Design Inc.
Fernley, Nevada

Offline cadbyken

  • Premier Member
  • *****
  • Posts: 4792
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #4 on: Feb 12, 2018, 02:02:32 PM »
Using a lisp you could
   1.  pick the elevations by selecting the two nodes. 
   2.  place a dimension with the dim changed to read the elevation with a suffix of ELEV or whatever tag you want it to be to denote that it is an elevation, not a linear dim

Edit: use something like this:
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/overriding-a-dimension-value-through-autolisp/td-p/810531
« Last Edit: Feb 12, 2018, 02:04:57 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 #5 on: Feb 12, 2018, 08:44:56 PM »
Using the LISP+Altered Dimension could be a solution, I will have to spend some time entertaining that idea...

Thanks for the help guys!

It's funny that AutoCAD doesn't have a solution for those cases, also funny how you can easily tag offsets up/dn with offsets CIDs but NOT if they offset horizontally   ;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 VirtualPilotTopic starter

  • Premier Member
  • *****
  • Posts: 6392
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #6 on: Feb 13, 2018, 05:06:34 PM »
OK, I've been looking at a LISP routine and getting confused on getting the Z ELEV from the ducts, all I need is a LISP function that reads the Z ELEV from the two ducts picked and then writes the difference to the already placed dimension on the drawing, neat if I cal also add the "UP ->" to the end of the number... of course I would rewrite it for those cases where ducts are actually going down...

Anyone have a direction I can take a look and figure this?

TIA!
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 #7 on: Feb 13, 2018, 05:38:53 PM »
I would just pick the nodes...then you can calculate the difference using the cdrr (or something like that) function (been a while).

If you did it the way you ask, you will need to do it through scripting then export out and import into lisp via a file.

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 cadbyken

  • Premier Member
  • *****
  • Posts: 4792
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #8 on: Feb 13, 2018, 05:44:33 PM »
Something like this (didn't test, put in the prompts, declare variables, set osnap, etc)

Code: [Select]
(setq PT1 (getpoint))
(setq PT2 (getpoint))
(setq PT1 (caddr PT1))
(setq PT2 (caddr PT2))
(setq DIST (abs(distance PT1 PT2)))

edit: Also, looking at your example, you could program it to put in the UP or DN depending on the elevation change.
« Last Edit: Feb 13, 2018, 05:46:15 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 #9 on: Feb 13, 2018, 06:32:52 PM »
I would just pick the nodes...then you can calculate the difference using the cdrr (or something like that) function (been a while).

If you did it the way you ask, you will need to do it through scripting then export out and import into lisp via a file.

My idea is to throw the dimension there between the ducts, then run a script that will allow me to pick the two nodes on the ducts, calculate the elevation and then allow to pick the dimension to replace the text with the elevation plus the "UP ->" text added at the end... simple right?  ;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 cadbyken

  • Premier Member
  • *****
  • Posts: 4792
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #10 on: Feb 13, 2018, 06:50:24 PM »
You could have the lisp put the dimension in then have the lisp modify last object.

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 #11 on: Feb 13, 2018, 07:08:06 PM »
You could have the lisp put the dimension in then have the lisp modify last object.

Was trying to make the LISP simpler by it not having to also place the DIM...  I have found some examples googling on how to replace the DIM text... now to find how to get the two points and do a simple calc...
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 #12 on: Feb 13, 2018, 08:08:45 PM »
Was trying to make the LISP simpler by it not having to also place the DIM...  I have found some examples googling on how to replace the DIM text... now to find how to get the two points and do a simple calc...

Bolded was outlined above. To get the dim placed, all it will require is an additional getpoint function for where the text would end up. The rest is already there.

Code: [Select]
(setq PT3 (getpoint "\nPick location of text "))
(command "dimlinear" PT1 PT2 PT3)
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 #13 on: Feb 13, 2018, 08:51:28 PM »
PHEW! I got a LISP started, it works at picking the points and then editing the DIM with the Z VALUE...

I only need now to format the DIM to even inches and add the "UP ->" at the end... getting there!

Code: [Select]
(defun c:ZDIF (/ pt1 pt2 z1 z2 dif edim)
(setq pt1 (getpoint "\nDUCT 1 NODE: "))
(setq pt2 (getpoint "\nDUCT 2 NODE: "))
(setq z1 (caddr pt1))
(setq z2 (caddr pt2))
(setq dif (- z2 z1))
(vl-load-com)
(setq edim (vlax-ename->vla-object (car (entsel "\Select dimension"))) )
(vla-put-TextOverride edim dif)
(princ)
)
« Last Edit: Feb 13, 2018, 08:54:15 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

Offline VirtualPilotTopic starter

  • Premier Member
  • *****
  • Posts: 6392
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #14 on: Feb 14, 2018, 03:34:49 PM »
Anyone know how to edit the code above to add to the text dimension a suffix of " " UP ->"  ?

So it will end up looking like

 47" UP ->
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