Author Topic: Z Dimensions question  (Read 3244 times)

0 Members and 1 Guest are viewing this topic.

Online cadbyken

  • Premier Member
  • *****
  • Posts: 5298
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #15 on: Feb 14, 2018, 15: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, 15:58:18 PM by cadbyken »
Ken Taylor - Atlantic Constructors, Inc
BIM Technology & Database Manager
Revit - not ready for Primetime given all of the add-ons, work arounds, and general issues with Fabrication in Revit.  Tired of them taking our money for little results.

Offline VirtualPilotTopic starter

  • Premier Member
  • *****
  • Posts: 6735
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #16 on: Feb 14, 2018, 16: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
Pre-Production Mgr - DIXIE Metal Products

Offline cadbob

  • Premier Member
  • *****
  • Posts: 2884
  • Country: us
  • Gender: Male
    • SMWIA Local 17
Re: Z Dimensions question
« Reply #17 on: Feb 14, 2018, 19: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
When someone asks where you see yourself in 5 years... Buddy, I'm just trying to make it to Friday. :)

Online cadbyken

  • Premier Member
  • *****
  • Posts: 5298
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #18 on: Feb 14, 2018, 20:05:43 PM »
Bob it could be done through a prompt as well.
Ken Taylor - Atlantic Constructors, Inc
BIM Technology & Database Manager
Revit - not ready for Primetime given all of the add-ons, work arounds, and general issues with Fabrication in Revit.  Tired of them taking our money for little results.

Offline cadbob

  • Premier Member
  • *****
  • Posts: 2884
  • Country: us
  • Gender: Male
    • SMWIA Local 17
Re: Z Dimensions question
« Reply #19 on: Feb 14, 2018, 20:13:37 PM »
Yup true Ken, not thinking clearly here Flu!  :-[
When someone asks where you see yourself in 5 years... Buddy, I'm just trying to make it to Friday. :)

Offline VirtualPilotTopic starter

  • Premier Member
  • *****
  • Posts: 6735
  • 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
Pre-Production Mgr - DIXIE Metal Products

Offline VirtualPilotTopic starter

  • Premier Member
  • *****
  • Posts: 6735
  • 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
Pre-Production Mgr - DIXIE Metal Products

Online cadbyken

  • Premier Member
  • *****
  • Posts: 5298
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #22 on: Feb 15, 2018, 13: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 - Atlantic Constructors, Inc
BIM Technology & Database Manager
Revit - not ready for Primetime given all of the add-ons, work arounds, and general issues with Fabrication in Revit.  Tired of them taking our money for little results.

Offline VirtualPilotTopic starter

  • Premier Member
  • *****
  • Posts: 6735
  • Country: us
  • Gender: Male
Re: Z Dimensions question
« Reply #23 on: Feb 15, 2018, 14: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, 14:34:48 PM by VirtualPilot »
Santos Cedeno
Pre-Production Mgr - DIXIE Metal Products