HELP! Totally lost where to begin on this one!

HELP! Totally lost where to begin on this one!

Anonymous
Not applicable
1,440 Views
14 Replies
Message 1 of 15

HELP! Totally lost where to begin on this one!

Anonymous
Not applicable
Got an idea for a terrific routine, one that I'd like to write, but am not
sure my skills are developed enough!

Here's what I want to do:

1. Issue a command called QUANTIZE.LSP.
2. Have the routine prompt me for a point (Quantize Base).
3. Have the routine prompt me for a selection set (or default to ALL).
4. Have the routine then prompt me for a Quantize distance value (to become
a SNAP distance).
5. Adjust ALL the objects endpoints and insertion points to "snap" to the
nearest Quantization Point.

Here's why I want it.

I often get files from other users that DON'T use Osnaps when drawing
architectural plans and details. They will draw with a less-than desireable
amount of accuracy. Their lines may not meet endpoint to endpoint, but may
be off by VERY small amounts- usually less than 1/8". Sometimes they have
gaps at their wall "intersections" sometimes they overlap. It creates havoc
when trying to dimension and work with their drawings.

Architectural objects usually have only a 1/2" or 1/4" need for accuracy.
Wall thicknesses are usually drawn to actual wood stud thickness (3.5" or
5.5") and lengths of walls are usually to the nearest inch. Having a
Quantize routine would allow me to FORCE their drawings to the nearest 1/2"
'quantize snapmode' settings.

Any help would be greatly appreciated!!!

Sincerely,
Robert Grandmaison
0 Likes
1,441 Views
14 Replies
Replies (14)
Message 2 of 15

Anonymous
Not applicable
Think I've got it kind of figured out....need to finish hammering it
together this weekend- I should be able to get it to fly...but still hoping
someone can show me a better way!

Cheers,
Robert
0 Likes
Message 3 of 15

Anonymous
Not applicable
Robert,

That may not produce the results that you desire.

Say two lines "nearly" meet. The endpoint of line one could be
closer to a particular snap point than the endpoint of line two,
which could itself be closer to an adjacent snap point (vertical or
horizontal). It would then produce a gap, or an overlap of the snap
distance.

Perhaps a routine could be created utilizing a crossing window with
SSGET whereby you could select two or more endpoints (for example),
and one endpoint would move to the nearest snap point, and the
second/other endpoint(s) would also move to that point. Of course
that would require a lot of individual area selections, but you would
probably also be zoomed in close enough to affirm or undo the result.

Just food for thought.
--
Dave D

Robert Grandmaison wrote in article
...
> Got an idea for a terrific routine, one that I'd like to write, but
am not
> sure my skills are developed enough!
>
> Here's what I want to do:
>
> 1. Issue a command called QUANTIZE.LSP.
> 2. Have the routine prompt me for a point (Quantize Base).
> 3. Have the routine prompt me for a selection set (or default to
ALL).
> 4. Have the routine then prompt me for a Quantize distance value
(to become
> a SNAP distance).
> 5. Adjust ALL the objects endpoints and insertion points to "snap"
to the
> nearest Quantization Point.
>
> Here's why I want it.
>
> I often get files from other users that DON'T use Osnaps when
drawing
> architectural plans and details. They will draw with a less-than
desireable
> amount of accuracy. Their lines may not meet endpoint to endpoint,
but may
> be off by VERY small amounts- usually less than 1/8". Sometimes
they have
> gaps at their wall "intersections" sometimes they overlap. It
creates havoc
> when trying to dimension and work with their drawings.
>
> Architectural objects usually have only a 1/2" or 1/4" need for
accuracy.
> Wall thicknesses are usually drawn to actual wood stud thickness
(3.5" or
> 5.5") and lengths of walls are usually to the nearest inch. Having
a
> Quantize routine would allow me to FORCE their drawings to the
nearest 1/2"
> 'quantize snapmode' settings.
>
> Any help would be greatly appreciated!!!
>
> Sincerely,
> Robert Grandmaison
>
>
0 Likes
Message 4 of 15

Anonymous
Not applicable
David,

I understand what you're saying, but it WILL produce the results I
need...here's why!

Usually, what happens is whoever drew the original drawing was only off by a
VERY small fraction of an inch- usually well less than 1/16" in fact. So, by
forcing all endpoints (assoc 10 & 11's) with entmod to relocate those line
definition points to the quantization "snaps" it should work like a dream.

Now, the problem is, of course, if they are off by MORE than a small
amount...in which case something like you're suggesting would work.

But, here's the problem- I usually DON'T know which lines are off by that
small amount until AFTER I've drawn and snapped my lines to what appear to
be valid endpoints or intersections of lines. Only after a few hours of
work, and having what should be ORTHOGONAL lines appear slightly askew do I
realize that the drawing I was tracing WASN'T DRAWN ACCURATELY! Yuck.

So, I want something that can run quickly and just check for those VERY
small incremental discrepencies and snap all the endpoints to the proper
locations.

I'm still working on it. I'll let you know how it works!

Cheers,
Robert Grandmaison

David Doane wrote in message
news:01bfac7c$783dc720$9255d2d0@lms-1...
> Robert,
>
> That may not produce the results that you desire.
>
> Say two lines "nearly" meet. The endpoint of line one could be
> closer to a particular snap point than the endpoint of line two,
> which could itself be closer to an adjacent snap point (vertical or
> horizontal). It would then produce a gap, or an overlap of the snap
> distance.
>
> Perhaps a routine could be created utilizing a crossing window with
> SSGET whereby you could select two or more endpoints (for example),
> and one endpoint would move to the nearest snap point, and the
> second/other endpoint(s) would also move to that point. Of course
> that would require a lot of individual area selections, but you would
> probably also be zoomed in close enough to affirm or undo the result.
>
> Just food for thought.
> --
> Dave D
>
> Robert Grandmaison wrote in article
> ...
> > Got an idea for a terrific routine, one that I'd like to write, but
> am not
> > sure my skills are developed enough!
> >
> > Here's what I want to do:
> >
> > 1. Issue a command called QUANTIZE.LSP.
> > 2. Have the routine prompt me for a point (Quantize Base).
> > 3. Have the routine prompt me for a selection set (or default to
> ALL).
> > 4. Have the routine then prompt me for a Quantize distance value
> (to become
> > a SNAP distance).
> > 5. Adjust ALL the objects endpoints and insertion points to "snap"
> to the
> > nearest Quantization Point.
> >
> > Here's why I want it.
> >
> > I often get files from other users that DON'T use Osnaps when
> drawing
> > architectural plans and details. They will draw with a less-than
> desireable
> > amount of accuracy. Their lines may not meet endpoint to endpoint,
> but may
> > be off by VERY small amounts- usually less than 1/8". Sometimes
> they have
> > gaps at their wall "intersections" sometimes they overlap. It
> creates havoc
> > when trying to dimension and work with their drawings.
> >
> > Architectural objects usually have only a 1/2" or 1/4" need for
> accuracy.
> > Wall thicknesses are usually drawn to actual wood stud thickness
> (3.5" or
> > 5.5") and lengths of walls are usually to the nearest inch. Having
> a
> > Quantize routine would allow me to FORCE their drawings to the
> nearest 1/2"
> > 'quantize snapmode' settings.
> >
> > Any help would be greatly appreciated!!!
> >
> > Sincerely,
> > Robert Grandmaison
> >
> >
0 Likes
Message 5 of 15

Anonymous
Not applicable
Robert,
Not sure if the attached lisp will do you any good. Haven't tried it out,
not even sure where I got it, but I hope it is of some help.

to give Mr. Light due credit, the first line of his lisp routine reads:

;TIP1430.LSP: SNAPLINE.LSP Rectify Lines (c)1998, Galen A. Light

"Robert Grandmaison" wrote in message
news:[email protected]...
> David,
>
> I understand what you're saying, but it WILL produce the results I
> need...here's why!
>
> Usually, what happens is whoever drew the original drawing was only off by
a
> VERY small fraction of an inch- usually well less than 1/16" in fact. So,
by
> forcing all endpoints (assoc 10 & 11's) with entmod to relocate those line
> definition points to the quantization "snaps" it should work like a dream.
>
> Now, the problem is, of course, if they are off by MORE than a small
> amount...in which case something like you're suggesting would work.
>
> But, here's the problem- I usually DON'T know which lines are off by that
> small amount until AFTER I've drawn and snapped my lines to what appear to
> be valid endpoints or intersections of lines. Only after a few hours of
> work, and having what should be ORTHOGONAL lines appear slightly askew do
I
> realize that the drawing I was tracing WASN'T DRAWN ACCURATELY! Yuck.
>
> So, I want something that can run quickly and just check for those VERY
> small incremental discrepencies and snap all the endpoints to the proper
> locations.
>
> I'm still working on it. I'll let you know how it works!
>
> Cheers,
> Robert Grandmaison
>
> David Doane wrote in message
> news:01bfac7c$783dc720$9255d2d0@lms-1...
> > Robert,
> >
> > That may not produce the results that you desire.
> >
> > Say two lines "nearly" meet. The endpoint of line one could be
> > closer to a particular snap point than the endpoint of line two,
> > which could itself be closer to an adjacent snap point (vertical or
> > horizontal). It would then produce a gap, or an overlap of the snap
> > distance.
> >
> > Perhaps a routine could be created utilizing a crossing window with
> > SSGET whereby you could select two or more endpoints (for example),
> > and one endpoint would move to the nearest snap point, and the
> > second/other endpoint(s) would also move to that point. Of course
> > that would require a lot of individual area selections, but you would
> > probably also be zoomed in close enough to affirm or undo the result.
> >
> > Just food for thought.
> > --
> > Dave D
> >
> > Robert Grandmaison wrote in article
> > ...
> > > Got an idea for a terrific routine, one that I'd like to write, but
> > am not
> > > sure my skills are developed enough!
> > >
> > > Here's what I want to do:
> > >
> > > 1. Issue a command called QUANTIZE.LSP.
> > > 2. Have the routine prompt me for a point (Quantize Base).
> > > 3. Have the routine prompt me for a selection set (or default to
> > ALL).
> > > 4. Have the routine then prompt me for a Quantize distance value
> > (to become
> > > a SNAP distance).
> > > 5. Adjust ALL the objects endpoints and insertion points to "snap"
> > to the
> > > nearest Quantization Point.
> > >
> > > Here's why I want it.
> > >
> > > I often get files from other users that DON'T use Osnaps when
> > drawing
> > > architectural plans and details. They will draw with a less-than
> > desireable
> > > amount of accuracy. Their lines may not meet endpoint to endpoint,
> > but may
> > > be off by VERY small amounts- usually less than 1/8". Sometimes
> > they have
> > > gaps at their wall "intersections" sometimes they overlap. It
> > creates havoc
> > > when trying to dimension and work with their drawings.
> > >
> > > Architectural objects usually have only a 1/2" or 1/4" need for
> > accuracy.
> > > Wall thicknesses are usually drawn to actual wood stud thickness
> > (3.5" or
> > > 5.5") and lengths of walls are usually to the nearest inch. Having
> > a
> > > Quantize routine would allow me to FORCE their drawings to the
> > nearest 1/2"
> > > 'quantize snapmode' settings.
> > >
> > > Any help would be greatly appreciated!!!
> > >
> > > Sincerely,
> > > Robert Grandmaison
> > >
> > >
>
0 Likes
Message 6 of 15

Anonymous
Not applicable
Thanks Mark, I'll check it out!

Here's what I hammered together myself- I thought at first it was
beyond my skills. Guess I know more than I give myself credit for. ; )

Cheers,
Robert Grandmaison

;;; QUANTIZE.LSP
;;; Written by Robert Grandmaison
;;; April 23, 2000

;;; QUANTIZE prompts a user for a Quantize Value and a Quantize
;;; Origin Point (or defaults to the current UCS origin).
;;; QUANTIZE then prompts a user for a selection set and then
;;; modifies the endpoints of all lines within that selection
;;; set so they all "snap" to a quantization point.
;;; It's a useful routine for cleaning up walls on plans that
;;; may be off by just a small fraction of an inch- due to
;;; poor or improper drafting technique!

;;; Enjoy! If you find it useful, let me know: [email protected]

(defun c:Quantize (/ QV p1 ss spX spY spZ epX epY epZ curent counter)
(setvar "cmdecho" 0)
(setq QV (getreal "\nEnter Quantize Value: "))
(setq p1 (getpoint "\nPick Quantize Origin Point : "))
(if (= p1 nil) (setq p1 (getvar "UCSORG")))
(command "UCS" "N" p1)
(setq ss (ssget '((0 . "LINE"))))
(setq counter (1- (sslength ss)))
(while (> counter -1.0)
(setq curent (entget (ssname ss counter)))
(setq spX (/ (cadr (assoc 10 curent)) QV))
(setq spY (/ (caddr (assoc 10 curent)) QV))
(setq spZ (/ (cadddr (assoc 10 curent)) QV))
(setq epX (/ (cadr (assoc 11 curent)) QV))
(setq epY (/ (caddr (assoc 11 curent)) QV))
(setq epZ (/ (cadddr (assoc 11 curent)) QV))
(if (>= (- spX (fix spX)) 0.5) (setq spX (* QV (+ 1.0 (fix spX)))) (setq
spX (* QV (fix spX))))
(if (>= (- spY (fix spY)) 0.5) (setq spY (* QV (+ 1.0 (fix spY)))) (setq
spY (* QV (fix spY))))
(if (>= (- spZ (fix spZ)) 0.5) (setq spZ (* QV (+ 1.0 (fix spZ)))) (setq
spZ (* QV (fix spZ))))
(if (>= (- epX (fix epX)) 0.5) (setq epX (* QV (+ 1.0 (fix epX)))) (setq
epX (* QV (fix epX))))
(if (>= (- epY (fix epY)) 0.5) (setq epY (* QV (+ 1.0 (fix epY)))) (setq
epY (* QV (fix epY))))
(if (>= (- epZ (fix epZ)) 0.5) (setq epZ (* QV (+ 1.0 (fix epZ)))) (setq
epZ (* QV (fix epZ))))
(setq curent (subst (list 10 spX spY spZ) (assoc 10 curent) curent ))
(setq curent (subst (list 11 epX epY epZ) (assoc 11 curent) curent ))
(entmod curent)
(setq counter (1- counter)))
(command "UCS" "World")
(princ))
0 Likes
Message 7 of 15

Anonymous
Not applicable
Robert,

Attached is FIXUP.LSP that does basically what you want. It rounds off the data for most
common objects (line endpoints, LWPline and Pline vertices, circle centers and radii,
block insertion points, text alignment points, etc) to a user0-defined precision setting
(default is 1/2", I think). Works great, if I do say so myself. It also optionally checks
for and fixes block rotation angles.

For a foreign floor plan, I would first move the entire drawing from a corner of the
building or column grid intersection to some "nice" point like 50', 50',0. This will
ensure that all objects in the plan are related somehow to a good base point. Then run
Fixup.lsp on the drawing.

Once "fixed", you may find lines that do not have the same endpoint (because they rounded
off to a predefined distance) but with SNAP on, everything should be pretty easy to
adjust.

Matt
[email protected]

On Sat, 22 Apr 2000 12:38:47 +0000, "Robert Grandmaison" wrote:

>Got an idea for a terrific routine, one that I'd like to write, but am not
>sure my skills are developed enough!
>
>Here's what I want to do:
>
>1. Issue a command called QUANTIZE.LSP.
>2. Have the routine prompt me for a point (Quantize Base).
>3. Have the routine prompt me for a selection set (or default to ALL).
>4. Have the routine then prompt me for a Quantize distance value (to become
>a SNAP distance).
>5. Adjust ALL the objects endpoints and insertion points to "snap" to the
>nearest Quantization Point.
>
>Here's why I want it.
>
>I often get files from other users that DON'T use Osnaps when drawing
>architectural plans and details. They will draw with a less-than desireable
>amount of accuracy. Their lines may not meet endpoint to endpoint, but may
>be off by VERY small amounts- usually less than 1/8". Sometimes they have
>gaps at their wall "intersections" sometimes they overlap. It creates havoc
>when trying to dimension and work with their drawings.
>
>Architectural objects usually have only a 1/2" or 1/4" need for accuracy.
>Wall thicknesses are usually drawn to actual wood stud thickness (3.5" or
>5.5") and lengths of walls are usually to the nearest inch. Having a
>Quantize routine would allow me to FORCE their drawings to the nearest 1/2"
>'quantize snapmode' settings.
>
>Any help would be greatly appreciated!!!
>
>Sincerely,
>Robert Grandmaison
0 Likes
Message 8 of 15

Anonymous
Not applicable
Oops, a small correction to include some forgotten functions.

Matt
[email protected]

On Tue, 25 Apr 2000 18:56:29 +0000, Matt Stachoni wrote:
>Attached is FIXUP.LSP that does basically what you want.
0 Likes
Message 9 of 15

Anonymous
Not applicable
I would like to have a copy of this "FIXUP.LSP" command, but the attachment is not longer included in the post. Does anyone have a copy? Thanks.........
0 Likes
Message 10 of 15

Anonymous
Not applicable
This works well for line elements, but I need one that also Quanizes BLOCK insertion points and polyline vertices.
0 Likes
Message 11 of 15

Anonymous
Not applicable
Go to

http://discussion.autodesk.com/thread.jspa?threadID=641546

and copy and paste to your VLISP editor.




escribió en el mensaje news:[email protected]...
I would like to have a copy of this "FIXUP.LSP" command, but the attachment
is not longer included in the post. Does anyone have a copy? Thanks.........
0 Likes
Message 12 of 15

Anonymous
Not applicable
That's the wrong LISP. I had found it myself. It just happens to also be called "fixup.lsp". For what I need, perhaps it should be called "SNAPALL.lsp"?
0 Likes
Message 13 of 15

Anonymous
Not applicable

Matt,

Any chance you could upload a copy of the referenced LISP? It's no longer attached to your previous post.

0 Likes
Message 14 of 15

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

Matt,

Any chance you could upload a copy of the referenced LISP? It's no longer attached to your previous post.


In case Matt isn't still active....

 

This isn't the only thread on this subject.  I would guess that the QUANTALL.lsp routine by anim8er_gie on this thread:

http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Rounding-geometry-to-nearest-whole-nu... might do what you're looking for.  Search the Discussion Group and you'll find more approaches, some based on quantizing locations, and some based on orthogonalizing angles [for Lines, at least].

Kent Cooper, AIA
0 Likes
Message 15 of 15

stevor
Collaborator
Collaborator

Thanks for telling us nothing.

 

From you description, it sounds  you want only LINE ends changed to the closest grid points, of some spacing, ie, 1/16" or so. That spacing is critical because some LINEs, etc, may be further off.Pliines, Arcs, Inserts of Blocks are much more involved.

 

We choosed a 1/2" grid to 'realign' the oddball drawings we recieved for interior buildouts.

 

Also, we repeated the process of checking each end to find unattached ends, and try to fix them; and if not, mark them with thick red circles. The circles did much to help wayward drafters do better.

 

If you post an example DWG, not too big, and try for 2000, no reactors, odd fonts, etc.

 

S
0 Likes