Author Topic: Need a dimension finding prog.  (Read 10456 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: 16867
  • 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
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16867
  • 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.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16867
  • 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: 16867
  • 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: 16867
  • 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: 28708
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.

Mark

  • Custom Title
  • Seagull
  • Posts: 28708
Need a dimension finding prog.
« Reply #15 on: December 09, 2003, 10:16:43 AM »
Quote from: Craig
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.

When/If this place gets bigger then we might, I just hate making it to restrictive for new-comers.
TheSwamp.org  (serving the CAD community since 2003)

Mark

  • Custom Title
  • Seagull
  • Posts: 28708
Need a dimension finding prog.
« Reply #16 on: December 09, 2003, 10:18:50 AM »
Quote from: pochrist
OK sorry about my lax posting practice

No problem, I have done it myself. :D
TheSwamp.org  (serving the CAD community since 2003)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16867
  • Superior Stupidity at its best
Need a dimension finding prog.
« Reply #17 on: December 09, 2003, 10:34:42 AM »
As we all have..
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

SMadsen

  • Guest
Need a dimension finding prog.
« Reply #18 on: December 09, 2003, 02:47:28 PM »
Interesting problem. Took a swing at it and wrote a little routine to find dimensions with certain measurements. A fuzz factor can be applied to search a range of measurement:



Files DIMFIND.LSP and DIMFIND.DCL at http://www.smadsen.com/files/

If you download and use it, please report any bugs (as I'm sure there are some!)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16867
  • Superior Stupidity at its best
Need a dimension finding prog.
« Reply #19 on: December 09, 2003, 02:58:20 PM »
Aw..heck...ya beat me to 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

SMadsen

  • Guest
Need a dimension finding prog.
« Reply #20 on: December 09, 2003, 03:09:50 PM »
Of course I did .. you were going to use VBA, right?  :lol:  :lol:

Already found a bug, though. It's a no go in paper space with no active viewports.

pochrist

  • Guest
Need a dimension finding prog.
« Reply #21 on: December 09, 2003, 03:14:56 PM »
Ok I gave it try and it looks real nice,  :D but I can't get it too work,  :cry: (as in "find" any of my Dims) The Dialog loads fine and I fill in the info, but it comes up with 0" matches. Does it automatically scan the dwg for a matching Dim? It doesn't ask me to select anything so I'm guessing thats why. Also does the dim value have to be entered in decimal only or can I mix them. (3'-3.625") or (39.625) We use Archtectural Units so it would be easier not to have convert them manually. Like I said it looks real professional, I just seem to be having problems. Btw if it matters I'm useing Acad 2004 vanilla. Thanks alot. :)

Keb don't give up yet, I'd like to see what you could whip up with VBA. :wink:

SMadsen

  • Guest
Need a dimension finding prog.
« Reply #22 on: December 09, 2003, 03:29:32 PM »
Good question. I opened up one of those sample drawings that uses Arch. units and went "Huh?"

I always forget that some people use that 4'-3 2/16" stuff so that should definately be looked into. Thanks for the feed back.

Would you prefer to have a pick button to choose a dimension in order to provide the measurement?

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16867
  • Superior Stupidity at its best
Need a dimension finding prog.
« Reply #23 on: December 09, 2003, 03:39:53 PM »
Ok, I won't give up...
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

pochrist

  • Guest
Need a dimension finding prog.
« Reply #24 on: December 09, 2003, 05:38:11 PM »
SMadsen
Quote
Would you prefer to have a pick button to choose a dimension in order to provide the measurement?


You know I didn't even think of that,  :o but now that you mention it, it would be much easier than trying to type it in (I tend to get the format wrong and then have to re-type it again) :lol:  that would be a fool proof way of getting exactly what i need.  :P
 I like the ability to scan the matched items and then select the one to Zoom to. Thanks for all the work you've done :D

Mark

  • Custom Title
  • Seagull
  • Posts: 28708
Need a dimension finding prog.
« Reply #25 on: December 09, 2003, 05:41:07 PM »
>that would be a fool proof way of getting exactly what i need.

And probably the same can be said for the programmer<g>
TheSwamp.org  (serving the CAD community since 2003)

SMadsen

  • Guest
Need a dimension finding prog.
« Reply #26 on: December 09, 2003, 05:41:24 PM »
Try go to the link above .. the files are updated.

pochrist

  • Guest
Need a dimension finding prog.
« Reply #27 on: December 09, 2003, 10:59:13 PM »
Tested the routine and it works as promised, but... :oops:  (sorry for the But - it's legit though) the Zoom to option, well,  zooms off to the far right of my dwg in model space, not on the selected Dim. If you want to give me a place to upload or an E-mail Add and i'll send you a dwg of what I'm doing and you could see exactly what I see. Let me say again I really appreciate all the time you've put into this in such a short amount of time, it really is a nice routine. Thanks again. :)

SMadsen

  • Guest
Need a dimension finding prog.
« Reply #28 on: December 10, 2003, 03:51:35 AM »
Thanks pochrist, I appreciate the feedback. Don't be sorry for any 'buts', please. This was written in a few hours and should be considered a draft. Now comes the tricky part which is to test it and adjust it to all situations :)

For instance, the problem that you point out is mostly likely due to the fact that it was used in a UCS. It zooms by finding the WCS bounding box of each object. Naturally, it has to be converted to the current UCS in order to zoom correctly.

To answer your previous question, it doesn't ask you to select anything because it uses the measurement that you give it to filter out those dimensions that match. It can easily be adjusted to only search in a specified area, though.

By the way, do you see any problems with the units? I'm not used to imperial units so it's much easier to have you test that part.

I'll see if some free time comes up today to build in the WCS/UCS conversions.

pochrist

  • Guest
Need a dimension finding prog.
« Reply #29 on: December 10, 2003, 07:24:28 AM »
Quote
By the way, do you see any problems with the units? I'm not used to imperial units so it's much easier to have you test that part.


No, they seem to work find although I'll change my units to something else and see if it has any problems, if I see something funny I'll let you know. TIA

SMadsen

  • Guest
Need a dimension finding prog.
« Reply #30 on: December 10, 2003, 12:46:23 PM »
Good. Try the latest changes on http://www.smadsen.com/files/

Replace both DIMFIND.LSP and DIMFIND.DCL

If it still zooms incorrectly you can email me the drawing you talked about at stig.madsen@natmus.dk.

SMadsen

  • Guest
Need a dimension finding prog.
« Reply #31 on: December 11, 2003, 08:41:28 AM »
Corrected an error when displaying numbers of overrides and added a small view of overrides to a dimension (referenced objects in overrides are only shown by handle, though).

Updated files, DIMFIND.LSP and DIMFIND.DCL, can still be found at http://www.smadsen.com/files/