Author Topic: (Challenge) find the coordinates of a line...  (Read 8191 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: (Challenge) find the coordinates of a line...
« Reply #15 on: July 14, 2007, 01:25:26 AM »
hehehe

Evgeniy,
I've reconsidered my comments :)  that code works great if the line is oriented lower-left to upper-right, but fails otherwise .. :-(
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.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: (Challenge) find the coordinates of a line...
« Reply #16 on: July 14, 2007, 01:30:37 AM »
hehehe

Evgeniy,
I've reconsidered my comments :)  that code works great if the line is oriented lower-left to upper-right, but fails otherwise .. :-(

"The challenge is to find the coordinates of the line in THIS dwg."

In the task points of the beginning and the end were not asked!
It is necessary to search for coordinates, I have found  :)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: (Challenge) find the coordinates of a line...
« Reply #17 on: July 14, 2007, 01:32:44 AM »
.......  "The challenge is to find the coordinates of the line in THIS dwg."
......
It is necessary to search for coordinates, I have found  :)

:D Clever !
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.

BazzaCAD

  • Guest
Re: (Challenge) find the coordinates of a line...
« Reply #18 on: July 14, 2007, 01:45:10 AM »
Wow LE (Luis),
That's impressive, I can't be leave that was even passable without 1 VL* function.
No I don't have the answer to the riddle. I actually ask one of the Adsk developers & they said they didn't think it was passable. :)
Guess you've proven them wrong.

Kerry, why do you aways have to ask the difficult questions? :)
Yes, I'm thinking about side stepping. The actual DynBlk is much more complicated then the version I posted.
I just made it as simple as passable to try to see if it was even passable since I was told it wasn't.
I'm now thinking the LINE was a bad idea for the block. The real DynBlk has lots of lines in it, so how to determine which line you want the coords of?
I guess I could put that line on a special layer & get the coods of the line that's on that layer.
Opt. 2 would be to use POINT object in the DynBlk, then just get the coods of those 2 points & not even look at the lines...

Here's a screen shot of the actual block I need to work on. It shows the line I need to coods of, or Opt. 2 the points to get the coods of...
Fun ha? & that's only 1 visibility state.....
It's a DynBlk for ShearWalls in a building. We place them all over the place then we extract the coods to a txt file and the Engineers import them into there engineering software to run there calculations and all that stuff with.

Thx for all the help guys. It's really helpful.
« Last Edit: July 14, 2007, 01:54:57 AM by BazzaCAD »

BazzaCAD

  • Guest
Re: (Challenge) find the coordinates of a line...
« Reply #19 on: July 14, 2007, 01:48:31 AM »
hehehe

Evgeniy,
I've reconsidered my comments :)  that code works great if the line is oriented lower-left to upper-right, but fails otherwise .. :-(

"The challenge is to find the coordinates of the line in THIS dwg."

In the task points of the beginning and the end were not asked!
It is necessary to search for coordinates, I have found  :)

LOL, ok you win. :)

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: (Challenge) find the coordinates of a line...
« Reply #20 on: July 14, 2007, 01:51:02 AM »
I have won!  :-o

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: (Challenge) find the coordinates of a line...
« Reply #21 on: July 14, 2007, 01:55:24 AM »
I give victory LE!
In its program there are more than words...

BazzaCAD

  • Guest
Re: (Challenge) find the coordinates of a line...
« Reply #22 on: July 14, 2007, 01:58:11 AM »
I have won!  :-o

I'll ask Kerry to send you some black jelly beans. :)
But actually if we're choosing a winner I'd say it would have to be LE (Luis) at this point in time.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: (Challenge) find the coordinates of a line...
« Reply #23 on: July 14, 2007, 02:21:34 AM »
Barry, The solution should be possible in code.

The Block has  x, Y, Z scale and rotation.
The Length, left and right are attributes.
Thats all thats needed ... just some vector geometry  :-) simple

... just as Luis demonstrated.
« Last Edit: July 14, 2007, 02:27:14 AM by Kerry Brown »
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.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: (Challenge) find the coordinates of a line...
« Reply #24 on: July 14, 2007, 02:35:40 AM »
though this doesn't look correct ..

(GRDRAW p10 p11 7 -7)

I think they'd need to be translated from world to ucs ( which is what grdraw uses)
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.

BazzaCAD

  • Guest
Re: (Challenge) find the coordinates of a line...
« Reply #25 on: July 14, 2007, 02:41:41 AM »
Barry, The solution should be possible in code.

The Block has  x, Y, Z scale and rotation.
The Length, left and right are attributes.
Thats all thats needed ... just some vector geometry  :-) simple

... just as Luis demonstrated.

Yes, I see the light, anything is passable...
When I tried to figure this out before I was using the VL object & functions & all I could get was the coods of the block definition, not where the line was stretched to.
But like always Luis is the man.

BazzaCAD

  • Guest
Re: (Challenge) find the coordinates of a line...
« Reply #26 on: July 14, 2007, 02:45:07 AM »
My question is, why is the (draw_point) function included?
Yes it's cool, but isn't required to solve the prob. (but still appreciated)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: (Challenge) find the coordinates of a line...
« Reply #27 on: July 14, 2007, 03:14:40 AM »
Barry,
when you get a chance to have a good look at Luis's code the core is this ..

(setq ndata (nentsel))  to select the nested entity (the line)

The rest is assertions and translations due the the particular properties of a block.

I'm intending to  deduct from the beauty of the routine by stating it as simply as that.


added :
and yes, the (draw_point) is for artistic license to visually identify the extents of the line.

good stuff Luis :-)
« Last Edit: July 14, 2007, 03:16:47 AM by Kerry Brown »
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.

BazzaCAD

  • Guest
Re: (Challenge) find the coordinates of a line...
« Reply #28 on: July 14, 2007, 03:30:07 AM »
Ya I noticed that.
Learn something new every day. I always use (entsel).
Right now I'm converting the code to loop through the block looking for points & getting there coods.
The next hurdle is how to get it to work on a Selection Set. Since I'll have to run this on a whole dwg with lots of DynBlks in it.
I.E. How do you use the (nentsel) with a SS?
Maybe I'll figure out a way of doing this without the (nentsel), since I'm looping through the block anyways...