Author Topic: Dimension Text Override  (Read 5396 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Dimension Text Override
« Reply #15 on: January 27, 2012, 09:00:13 PM »
And you next question can be answered here:  8-)
Code: [Select]
-----------  Ldata - xData -------------
http://www.theswamp.org/index.php?topic=30445.0 Quick XData Functions by Lee Mac
http://www.theswamp.org/index.php?topic=31804.0
http://www.theswamp.org/index.php?topic=5003.0  MP - dictionaries and xRecords
http://www.theswamp.org/index.php?topic=1283.0  Ldata vs xData
http://www.theswamp.org/index.php?topic=4395.0
http://www.theswamp.org/index.php?topic=8829.0 
http://www.theswamp.org/index.php?topic=29381.0
http://www.theswamp.org/index.php?topic=23294.msg281024#msg281024 Ldata
http://www.theswamp.org/index.php?topic=29564.0
http://www.theswamp.org/index.php?topic=18490.0  Ldata example
http://cadtips.cadalyst.com/node/tiplisting?keywords=1756  Message Store Routine

  Data Structures
http://www.theswamp.org/index.php?topic=37660.msg427038#msg427038 LeeMac
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Bill Tillman

  • Guest
Re: Dimension Text Override
« Reply #16 on: January 27, 2012, 09:11:00 PM »
Yeah, cool idea...but I should also add that the dimensions to be overridden will be the same dimensions every time. A different code will be needed when we move to a different product line, but it will still be very similar. I will have to identify the handles of the dimensions in that drawing as well, and I just found another snippet of code on the AutoDesk site which cuts out all the crap and gives me just the handle information.

Code: [Select]
(defun c:gethandle ( / ed) ;;returns the handle of the selected entity
 (setq ed (entget (car (entsel "Select object: "))))
 (princ (strcat "\nEntity type: " (cdr (assoc 0 ed))))
 (princ "\n")
 (princ (cdr (assoc -1 ed)))
 (princ (strcat "\nEntity handle (permanent): " (cdr (assoc 5 ed))))
 (princ "\n")
 (princ)
 )
 
(prompt "Enter gethandle to run the program.")

And yes, a user will one day accidentally or purposefully overwrite my precious drawing template, but that's why I have and keep multiple backups. And the IT guys back everything up to tape each night so we're covered. I think that "handles" is the best way to "handle" this.

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Dimension Text Override
« Reply #17 on: January 27, 2012, 09:31:41 PM »
immho  ... Sounds like a potential mess to me.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Dimension Text Override
« Reply #18 on: January 27, 2012, 10:13:31 PM »
Consider this, you have 10 drawings with similar items but differ slightly. They have your target dimensions in them say 5 each.
So you have 50 handles to manage, where as with xdata you have 5 xdata flags and the can be the same  for all 10 drawings.
This means any routine you create only has to look for 5 xdata flags. That can be 100 or 1000 drawings and the xdata flags
remain the same and your software can always identify them. Do you see the flexibility here?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

mkweaver

  • Bull Frog
  • Posts: 352
Re: Dimension Text Override
« Reply #19 on: February 02, 2012, 09:16:50 AM »
OK, I would like to address that point....I have these drawings which have dimension objects on them. According to what I've read, the handle is the one object which does not ever change over the life of a drawing. And that's why I'm doing it this way. I think you may be headed down the path like the others that this is an interactive process, which it is not. A user who never uses AutoCAD will be able to answer a few questions in Excel, click a macro button and then sit back while AutoCAD launches and prepares their drawing for them. It all happens in the blink of an eye. And I can't have them interacting with the process in anyway.

However, as someone who is still very new to VLISP I'm all ears for advice and comments.

Note that the handles don't change until you do a recover, and possibly an audit.  Then all bets are off.

I think the XData approach would work best.

Jeff H

  • Needs a day job
  • Posts: 6151
Re: Dimension Text Override
« Reply #20 on: February 19, 2012, 01:21:48 PM »
If you are going to hard code and manually write down the handles I do know if this idea is any better.
Sounds to me by overriding the dimensions they really are not dimensions but just a piece text between lines. Since you already have to know the dimensions ahead of time put each one a different identifiable layer.(dim1Layer, or Part#Width, etc....)
 
If you are going with the approach mentioned why not just use regular text that can identified by its layer.

Or hell exploded the dimensions create a block with the text from the dimensions and use orgin as base point. Then change them to Attribute Definitions and insert back at orgin.

Wouldn't that be easier in Vlisp to modify a BlockReference AttributeReferences or insert a BlockReference and set and attach it Attribute References?
 
Quickly made pic from steps mentioned above.
 
 
« Last Edit: February 19, 2012, 01:38:53 PM by Jeff H »

Tom

  • Guest
Re: Dimension Text Override
« Reply #21 on: February 19, 2012, 05:16:32 PM »
Why not fix the dimensions that have to be over written to their own dim style DS1,DS2 etc,
 then instead of looking for just the dimension look for the style as well

Jeff H

  • Needs a day job
  • Posts: 6151
Re: Dimension Text Override
« Reply #22 on: February 20, 2012, 09:27:44 AM »
Why not fix the dimensions that have to be over written to their own dim style DS1,DS2 etc,
 then instead of looking for just the dimension look for the style as well
Even easier!