Author Topic: Challenge: Dim Reactor  (Read 8476 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Challenge: Dim Reactor
« on: August 20, 2008, 04:20:00 PM »
Those of us that use Architectural units typically dimension with feet and inches.
Using smaller dimensions, less than 2 feet, it is desirable in some cases to have the dimension in Inches only.
Seeing a comment on another forum gave me the idea that a reactor might be constructed to change the
dimension over ride to display inches and add the inch character as the suffix.

So the challenge would be to create a reactor to do just that for any command that created a dimension or
edited a dimension. There should be a user changeable threshold for the reactor to switch the dimension to inches
or back to feet & inches. There should also be a list of user supplied Dim Styles that would filter for allowable
Dim Styles. This would prevent some styles from being modified.

I would say that this is probably an advanced level challenge.
Anyone interested?
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.

Spike Wilbury

  • Guest
Re: Challenge: Dim Reactor
« Reply #1 on: August 20, 2008, 04:26:39 PM »
« Last Edit: August 20, 2008, 04:41:19 PM by LE »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Challenge: Dim Reactor
« Reply #2 on: August 20, 2008, 04:46:17 PM »
Yes Luis, I did not see that code.

PS I won't be able to test it tonight as I'm out till late.
« Last Edit: August 20, 2008, 04:50:19 PM by CAB »
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.

Spike Wilbury

  • Guest
Re: Challenge: Dim Reactor
« Reply #3 on: August 20, 2008, 04:59:24 PM »
Yes Luis, I did not see that code.

PS I won't be able to test it tonight as I'm out till late.



Alan,

Hope that helps... :)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Challenge: Dim Reactor
« Reply #4 on: August 20, 2008, 07:50:13 PM »
Just got in, that will likely do just fine.
I did not plan on writing the code I just though it would be a good challenge.
I'm hoping some folks may have an intrest in the writing of the code.
« Last Edit: August 21, 2008, 09:15:20 AM by CAB »
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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Challenge: Dim Reactor
« Reply #5 on: August 21, 2008, 09:20:42 AM »
See attached a copy of the lisp with the variables corrected as they were wrong type. Luis pointed this out.

Works well Luis, but there are some items that don't match my requirements.
I'm not asking Luis to alter the lisp. Just seeing if someone else wants to give it a go.

Routine does not alter the Dimension if it is modified, only when created.
Routine does not honer specific Dim Styles, works on all Dim Styles.
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.

Spike Wilbury

  • Guest
Re: Challenge: Dim Reactor
« Reply #6 on: August 21, 2008, 09:51:45 AM »
Just got in, that will likely do just fine.
I did not plan on writing the code I just though it would be a good challenge.
I'm hoping some folks may have an intrest in the writing of the code.

That code can be use as a start.... :)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Challenge: Dim Reactor
« Reply #7 on: August 21, 2008, 09:57:29 AM »
Yes, you did the hard part. 8-)
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.

Spike Wilbury

  • Guest
Re: Challenge: Dim Reactor
« Reply #8 on: August 21, 2008, 10:12:18 AM »
Yes, you did the hard part. 8-)

:)

Quote
Routine does not alter the Dimension if it is modified, only when created.
Routine does not honer specific Dim Styles, works on all Dim Styles.

Those two can be very easy to add..... (that's what I miss from lisp)

Let's see/wait if any other swamper come up with a solution...  :mrgreen:
« Last Edit: August 21, 2008, 12:52:05 PM by LE »

Spike Wilbury

  • Guest
Re: Challenge: Dim Reactor
« Reply #9 on: August 21, 2008, 04:41:35 PM »
The problem, is going to be in the "modified" event - owner is not open for write... and has to be included in a list and later do the updates from probably the Regen command (at the commandended event)... as far I recall

POCKETS

  • Guest
Re: Challenge: Dim Reactor
« Reply #10 on: August 21, 2008, 05:27:57 PM »
Cab,
I downloaded your fractdims.lsp but I can't get it to work.  I am looking for a "defun c" but there doesn't seem to be one.  Is there another way to get fractdims.lsp to work?   :|
Pockets

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Challenge: Dim Reactor
« Reply #11 on: August 21, 2008, 05:30:41 PM »
LE (luis) wrote the routine. It is a reactor, so just load it.
When you create a dimension < 48" it should show inches.
If the dim is > 48" it should show as set up in the Dim Style.
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.

Spike Wilbury

  • Guest
Re: Challenge: Dim Reactor
« Reply #12 on: August 21, 2008, 05:46:22 PM »
Cab,
I downloaded your fractdims.lsp but I can't get it to work.  I am looking for a "defun c" but there doesn't seem to be one.  Is there another way to get fractdims.lsp to work?   :|
Pockets

As Alan already mentioned.... and you can read the settings on top of the file ie:

Quote
;; variables
(setq auto_fract T) ;; ON === By simple changing this to nil (setq auto_fract nil) it will turn off the feature (not the reactor)
(setq min_dim_tol "0.25")
(setq max_dim_tol "48.0")
(setq dim_radius_suffix "\"")
(setq dim_radius_prefix "R=")
(setq dimstyles (list "DIM-1" "DIM-48" "DIM-96" "DIM-32")) N/A

Change the variables to suit your needs... hth

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Challenge: Dim Reactor
« Reply #13 on: August 21, 2008, 06:03:37 PM »
Here is a modified version.
If you stretch the dimension to <=48" it will change to inches.
But stretching the other way does not work yet. I'm pondering what to do when there are existing xdata overrides present.
The current routine overwrites existing xdata.

This is a test release.
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.

Spike Wilbury

  • Guest
Re: Challenge: Dim Reactor
« Reply #14 on: August 21, 2008, 07:00:54 PM »
Here is a modified version.
If you stretch the dimension to <=48" it will change to inches.
But stretching the other way does not work yet. I'm pondering what to do when there are existing xdata overrides present.
The current routine overwrites existing xdata.

This is a test release.

Alan,

have a look at this update, it works here back and forward, and even with matchprop too... please ignore the code enchilada I just did.

Notes:
1. I did not understood the cond usage the part "AcDbRadialDimension" - I thought that was taking care on "DIMRADIUS" - me might wrong.

2. I reuse my previous if's calls

3. Added a new function to change the xdata, but this can be place on a single function, merge fractional-dim and fractional-dim-arch

4. hth

5. almost forgot.... so where are the swamp lispers ?