Author Topic: Draw diagonal hatch lines in rectangle by pick  (Read 6826 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #15 on: April 16, 2021, 12:28:09 PM »
And the photo
Just curious, in what profession do you use these 'x' boxes?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #16 on: April 16, 2021, 12:28:59 PM »
Here is my attempt for your second request and hopefully Ron won't mind.
...
Not at all :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Christina

  • Newt
  • Posts: 27
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #17 on: April 16, 2021, 08:32:41 PM »
Hello Tharwat,
Much appreciate your effort!
I have been testing a lot and only a few times it went wrong. But I am very satisfied!
Here is a photo just to be sure because you may know why it can go wrong?
It only happens with a standing rectangle, straight with 4 angles of 90 °.
Cannot reproduce the error it happened spontaneously... with the same error over and over; the zigzag goes to the right as shown in the picture.
But like I said, no problem for me!
Would like to thank you all very much!  :smitten:

Christina

Christina

  • Newt
  • Posts: 27
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #18 on: April 16, 2021, 08:56:51 PM »
Quote
Just curious, in what profession do you use these 'x' boxes?

Hello Ron,
I use it to draw cabinets on my floor plans. I am a student in the healthcare sector but I have become addicted to 3D Architecture.  :idiot2:
Every month I draw a new dream passive house, haha Export it to Sketchup to calculate the shadow's and render it in Enscape or Cinema4D.
Attached a photo with your  x boxes...

Christina

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #19 on: April 17, 2021, 01:27:45 AM »
https://drive.google.com/file/d/1U0RsF5Y8_6r3pMVMZ5oSLmwnf8HYAKx6/view?usp=sharing

however, you can do, more or less, the same thing, just by using a dynamic block.

A limitation of dynamic blocks is that
it is not possible to change the distance between columns or rows of the "ARRAY" action.

Or rather, it can only be done when you design the dynamic block.

But this is not possible at "run time".

To get around this problem,
you have to MANUALLY scale (with the SCALE command) the block
so that it has the width you need
and then it's all easy.

Just play with it a little bit, and you'll see.

. . . And you will notice that there is also an alignment grip.

If you don't already know it, you will find it interesting!

ciao
« Last Edit: April 17, 2021, 01:38:09 AM by domenicomaria »

Tharwat

  • Swamp Rat
  • Posts: 707
  • Hypersensitive
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #20 on: April 17, 2021, 02:22:29 AM »
Hello Tharwat,
Much appreciate your effort!
I have been testing a lot and only a few times it went wrong. But I am very satisfied!
Here is a photo just to be sure because you may know why it can go wrong?
It only happens with a standing rectangle, straight with 4 angles of 90 °.
Cannot reproduce the error it happened spontaneously... with the same error over and over; the zigzag goes to the right as shown in the picture.
You're welcome.

Can you please share that part of the drawing where the program fails to produce the correct shape ?

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #21 on: April 17, 2021, 03:19:18 AM »
Quote
Can you please share that part of the drawing where the program fails to produce the correct shape ?

Maybe you need only to set OSMODE=0

Tharwat

  • Swamp Rat
  • Posts: 707
  • Hypersensitive
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #22 on: April 17, 2021, 03:25:05 AM »
Quote
Can you please share that part of the drawing where the program fails to produce the correct shape ?

Maybe you need only to set OSMODE=0
Its not a matter of guessing.  :no:

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #23 on: April 17, 2021, 03:25:33 AM »
I added a FLIP GRIP and ACTION
to CHANGE easily the ARRAY DIRECTION . . .

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #24 on: April 17, 2021, 03:27:17 AM »
Quote
Its not a matter of guessing.

to understand, sometimes you need to make assumptions. . .

Tharwat

  • Swamp Rat
  • Posts: 707
  • Hypersensitive
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #25 on: April 17, 2021, 03:32:26 AM »
Quote
Its not a matter of guessing.

to understand, sometimes you need to make assumptions. . .
Why to guess since the codes in front of you that you can read to know if your expectation was right ?

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #26 on: April 17, 2021, 04:01:05 AM »
Quote
Why to guess since the codes in front of you that you can read to know if your expectation was right ?

I have read your code and it seems to me that there are no problems. . .
. . . but maybe you are right. . .
. . . there can be many reasons that produce an error. . .
. . . and that at first sight, they are not considered. . .

. . . mine was just a hypothesis . . .

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #27 on: April 17, 2021, 08:20:38 AM »
in retrospect,
I believe that the error is due to the fact that
the points that define the upper short segment
are for some reason reversed . . .
 
. . . I think this, observing  the kind of mistake
Christina pointed out in the attached image.

in fact, the angle of the long segment is wrong
and it is instead that of the diagonal of the rectangle. . .
. . .
so the problem is:
what happens when you acquire
and process the boundary points?
. . .
maybe you should make sure that
the 4 segments of the rectangle
(obtained from your 4 processed points)
do not intersect with each other
. . .
and to always get the same behavior,
you should know whether the direction of the point list
is clockwise or anti-clockwise
. . .
« Last Edit: April 17, 2021, 08:39:47 AM by domenicomaria »

Christina

  • Newt
  • Posts: 27
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #28 on: April 17, 2021, 09:31:46 AM »
Hello Domenicomaria,

Your information about the dynamic blocks seems very interesting to me and I will have a good look at how something like this works.
But for me it is all about the code of the experts here because I can make some small additions to it. After that  I work out everything in OpenDCL so that I have a nice tool with all the bells and my whistles. In the picture you can see what I mean; with this tool I make my stairs.
When i press on a label or textbox, I get an image on the right with all the necessary explanations ... very important for me because i can be so stupid.

Thank you for the info!

Christina

Christina

  • Newt
  • Posts: 27
Re: Draw diagonal hatch lines in rectangle by pick
« Reply #29 on: April 17, 2021, 09:53:09 AM »
Quote
Can you please share that part of the drawing where the program fails to produce the correct shape ?

Hello Tharwat,

I have test it approximately 700 times  :crazy2:
And got only 3 errors... these are different to the previous one.
But for me its a dream code  :smitten:
I am using Acad 2022...

Thank you for your time!

Christina