Author Topic: Need a dimension finding prog.  (Read 15317 times)

0 Members and 1 Guest are viewing this topic.

Anonymous

  • Guest
Need a dimension finding prog.
« on: December 08, 2003, 09:00:19 PM »
I've posted this very question on 3 forums and have yet to get respone (let alone an answer). :shock:  Now either this is such a complex question that very few can or will attempt to anwer it (yeah right...) :?  or It's so stupid that it gets ignored for that reason alone. :roll: In any event can some one give me a sign.

IS there a  tool (lisp, arx, Vba) that can search for a specified Dimesion in Autocad 2004. We manufacture custom stone facade and we tag each piece by size, I need to be able to locate - find / search through all or selected Dims to see if a specific size has already been tagged.
PS All dimensions are Associative - not text over-rides.
TIA


edited the subject name to make it user friendly.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Need a dimension finding prog.
« Reply #1 on: December 08, 2003, 09:17:19 PM »
Lets see if I understand you correctly....

You have a drawing, with many dimensions, each are set to a value, as predefined by the dimension style, and each one is associative and have no text overrides.

The problem you have been receiving is that you cannot adequately filter the dimensions because the default text for a dimension with no override is <>.

Once you are able to identify the dimension, then you would like to identify the item associated with that dimension.

Now, since I think I understand the question adequately, lets see if I can come up with a solution. After all, that is what I do... solutions...

Lets see if I have all of the components...

Select all dimensions...
Identify dimension length to search for...
Filter all dimensions according to length...
Discard all dimensions not meeting specifications...
Identify those dimensions to the user...

Hmmmm......
I think it is doable, but I will have to cogitate a bit to come up with the entire solution...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Need a dimension finding prog.
« Reply #2 on: December 08, 2003, 10:24:56 PM »
The text displayed in associative dims is not exposed to COM and is not available via DXF group code.

The DXF group 42 < editkwb > or obj.measurement return the actual real measurement without formatting for the over-rides used to display the text value.

The value has to be revese calculated based on all the possible over-rides, and is not a simple matter of reading the value.
.. or explode each dim & catch the displayed text value then undo the explode
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Need a dimension finding prog.
« Reply #3 on: December 08, 2003, 10:39:51 PM »
Quote from: Kerry B
... DXF group 34 or obj.measurement ...

Actually it is DXF 42 for dimensions
Alright, try this....
Code: [Select]


(defun C:dimsel()
  (setq searchdist (getdist "\nEnter length dimension to find: "))
  (setq a (entget (car (entsel))))
  (if (= (distof(rtos searchdist (getvar "lunits")(getvar "luprec")))
(distof(rtos (cdr (assoc 42 a))(getvar "lunits")(getvar "luprec"))))
    (progn
      (redraw (cdr (assoc -1 a)) 3)
      (princ "\n/Match found")
    )  
  )  
)


Now what this will do is find a single dimension that you select and test it against the entered dimension length for finding. Of course the dimension will match if you type in the length of the dimension you are going to select. It should be a simple thing to make the routine filter the selected dimensions and test them against the default searchdist.

In order to make sure the dimensions are equal, rather than use a fuzz factor, I simply had both numbers converted to the same string format using the same rounding, then converted to a number using the same rounding. This way when the dimension is set to 1/8" accuracy, and the dimension is actually at 3/32, it will find it as a match if you enter 1/8"

I have not done extensive testing,  but I am sure with the many talented  people here, we will see some more code to improve upon this rudimentary incarnation.

The routine will highlight the dimension if it is found to match the entered value.

Let us know if this is the direction you want to go...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Need a dimension finding prog.
« Reply #4 on: December 08, 2003, 10:56:52 PM »
Quote from: KEB
Actually it is DXF 42 for dimensions
Alright, try this....


Oops ... my bad.  I did that from memory. sorry, memory is shot.

kwb.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Need a dimension finding prog.
« Reply #5 on: December 08, 2003, 11:24:20 PM »
No problem... I do that on occasion as well...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Anonymous

  • Guest
Need a dimension finding prog.
« Reply #6 on: December 09, 2003, 08:21:50 AM »
Thanks Keb for all the help, :P  the routine works good as described, I'm guessing this was a trial run. Is it it possible:

1). To select more than one object .

2). Add a "zoom to" feature, like the current Acad Find and Replace command does.

3). Not real important, but can the routine list or print to the command line a total of how many matches it found. (ie. 10 matches found).
Thanks again for the quick response.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Need a dimension finding prog.
« Reply #7 on: December 09, 2003, 08:27:29 AM »
Well, why didn't you say so...

Would a VBA program be ok... This really begs to be dialog driven and I hate programming forms in DCL, although I can do it...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Anonymous

  • Guest
Need a dimension finding prog.
« Reply #8 on: December 09, 2003, 09:29:32 AM »
Thats fine with me, what ever you think is the best. Can this routine currently find text over-rides as well? I know i specified Associative dims, but I thought it might be a good idea to have that feature also, because I will undoutedly run into a dwg that has them, I don't over-ride dims as rule, but there are some who do. Thanks for the help.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Need a dimension finding prog.
« Reply #9 on: December 09, 2003, 09:40:49 AM »
Well, I suppose I could include something to do that. Let me get started.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Need a dimension finding prog.
« Reply #10 on: December 09, 2003, 09:53:20 AM »
Dear Guest

KEB is taking the time to to fulfill your original question and then some. The application that he is writing would likely cost you or your company several hundred dollars if you were to hire KEB to do it. But, because we enjoy helping out our fellow CAD types, you are getting the application for free! So please consider joining our little group and become a member of TheSwamp, it's also free.

Thanks
TheSwamp.org  (serving the CAD community since 2003)

daron

  • Guest
Need a dimension finding prog.
« Reply #11 on: December 09, 2003, 09:59:02 AM »
Way to go Mark. :D

pochrist

  • Guest
Need a dimension finding prog.
« Reply #12 on: December 09, 2003, 10:08:06 AM »
Mark I fully agree, I did register last night, but failed to notice that I was able to post, with out a login. I just logged on to post this reply, so I expect that when I submit this that it will show my name, but if not perhaps there is problem. So here goes.

Craig

  • Guest
Need a dimension finding prog.
« Reply #13 on: December 09, 2003, 10:11:48 AM »
Mark, What you might want to do is change your permission settings in each category to where a guest CAN read the post but can do nothing else until they log in. Just an idea that might eliminate this problem.  :o

pochrist

  • Guest
Need a dimension finding prog.
« Reply #14 on: December 09, 2003, 10:11:59 AM »
OK sorry about my lax posting practice,  :oops: I'm used to forums that won't let you post with out logging in first. I greatly appreciate all the help Keb has provided. I will contribute where i can, and what I can.  :P Thanks again.