How to Hatch all with action recorder?

How to Hatch all with action recorder?

Sander_Va
Explorer Explorer
1,714 Views
17 Replies
Message 1 of 18

How to Hatch all with action recorder?

Sander_Va
Explorer
Explorer

I'm trying to create a macro where i want to hatch several (+-50) closed polylines all at once.

I tried to look for solutions on forums and found out you have to use the command '-Hatch' instead of 'Hatch'.

This way I am able to hit 'S' to select object followed by 'ALL' to select all the polylines. But when i hit enter afterwards it doesn't hatch anything. 

I tried doing these steps again followed by hitting 'P' to open properties and then hit enter and this seems to hatch them (somehow). but when i repeat the macro afterwards it gives an error.

 

Any solutions to this where i don't need to click the closed polylines as the macro doesn't register this?

 

Thanks!

0 Likes
Accepted solutions (1)
1,715 Views
17 Replies
Replies (17)
Message 2 of 18

ChicagoLooper
Mentor
Mentor

Hi @Sander_Va 

Are all the 'closed polylines' on the same layer?

Or are they on multiple layers?

 

If on more than one layer, try selecting a closed polyline where each and and every layer is represented in your selection set. You don't have to select ALL polylines just make sure you've selected enough so each layer is represented. For example you have 100 closed polylines, 25 on layer A, 30 on layer B, and 45 on layer C, you'll need to select a minimum of 3 polylines one from each layer. You may select more than 3 but you'll still need to select at least one from each layer.

 

With the 3 polylines still selected=>Right click and=>Select Similar=>Isolate Selected Objects.

With the closed polylines isolated you can now perform HATCH. Be sure to use a crossing window when choosing the objects to hatch. 

 

When the hatch operation is finished=>right click in an blank, empty area of modelspace=>End Isolation.

 

You're better off performing the hatch manually because you can hatch all polygons simultaneously. The only reason why you wouldn't be able to hatch all objects at the same time is when using multiple hatch patterns.

 

Even if you were to use the Action Recorder with multiple hatch patterns, how would the Recorder determine which objects get THIS pattern and which objects get THAT hatch pattern.

 

If you're using more than one hatch, it seems you need to provide some human input to designate which hatch the polygon is to receive. And human input defeats the purpose of using the Action Recorder recorder in the first place.

 

Chicagolooper

EESignature

0 Likes
Message 3 of 18

Sander_Va
Explorer
Explorer

Hi, 

 

Thanks for your reply.

 

All of my polylines that i want to hatch are on the same layer. 

I want to prevent using a crossing window when doing the action record because I want to use the hatch all in seperate drawings with different coördinates.

 

I have tons of drawings where i need to hatch closed polylines. there are 2 separate layers in each drawing that needs to be hatched in a different color/pattern. But even making it so it hatches 1 layer automaticly would save me alot of time. 

0 Likes
Message 4 of 18

ChicagoLooper
Mentor
Mentor

@Sander_Va 

<<All of my polylines that i want to hatch are on the same layer.>>

Same layer?

 

<<…there are 2 separate layers in each drawing that needs to be hatched…>>

Separate layers?

So you have two hatch patterns and you want the action recorder to determine which polyline gets THIS hatch and which get THAT hatch? Correct?

 

 

Chicagolooper

EESignature

0 Likes
Message 5 of 18

Sander_Va
Explorer
Explorer

There are multiple layers in the drawings, but I was trying to make it work for just 1 layer at first. the pattern/color doesnt matter.

The problem is, it doesnt matter if there's 1 layer or more, it does not hatch my polylines without the use of crossing windows. 

 

steps i want to achieve: 

-make action recorder hatch multiple closed polylines in the same layer all at once without the use of crossing windows as that gives problems when replaying the recorded action. 

 

Hope this explains it a little better

0 Likes
Message 6 of 18

pendean
Community Legend
Community Legend

@Sander_Va wrote:

...steps i want to achieve: 

-make action recorder hatch multiple closed polylines in the same layer all at once without the use of crossing windows as that gives problems when replaying the recorded action. ...


How would the object selection happen then, isolate what you don't want and only grab what you want?

Remember, the recorder only mimics what you do on screen, nothing more, it cannot guess at selections.

 

Perhaps you should share 2 or more sample DWG files so we can understand what it is you are trying to automate, and to which objects in each sample.

0 Likes
Message 7 of 18

АлексЮстасу
Advisor
Advisor

For all objects.

For button or Tool Palette:   ^C^C_-HATCH;_S;_ALL;;;
and/or for the command line:   (command "_-HATCH" "_S" "_ALL" "" "")

 

For preselected objects:

^C^C_-HATCH;_S;_P;;;

(command "_-HATCH" "_S" "_P" "" "" "")

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

0 Likes
Message 8 of 18

ChicagoLooper
Mentor
Mentor

Hello, Mr @pendean 

Despite the hatch requirements outlined by the OP, the Action Recorder cannot be used to perform the operation he has eloquently described. Instead of asking how he can force the Action Recorder to fit his specific needs, he can ask how to use his current drawings to create practical output (or adapt existing output) which can be easily managed in Map3D. Doing that would open the proverbial door to finding new ways to solve recurring problems. 

 

He's heavily invested in the Action Recorder and unwilling to recognize the limitations that tool has when used under his circumstances and is desperately trying to make an inappropriate workflow into a usable one.

 

I'm sure the recipient of his work will welcome a drawing which differentiates one group of polylines from another. I'm just not convinced using hatch generated by the Action Recorder is the best way. 

 

Chicagolooper

EESignature

0 Likes
Message 9 of 18

Sander_Va
Explorer
Explorer

Hi,

 

I have tried this before, and without the recorder recording, this will work.

When you use the commands while recording it will just select the objects but not hatch them. it results in the screenshot that iv'e added.

 

0 Likes
Message 10 of 18

Sander_Va
Explorer
Explorer

If possible, you can try to reproduce it by doing following:

 

-draw multiple closed polylines

-command: '-hatch' + '-S' + '-ALL' and then press space/enter

 

It will result in the objects being hatched.

Now try to do the same step with the action recorder playing. 

 

It will result in the objects being selected but not hatched. and this is what my problem is.

0 Likes
Message 11 of 18

CADaSchtroumpf
Advisor
Advisor

I suggest this just in case...
This individually hatches each polyline with the ANSI31 pattern by orienting the angle of the hatch with the longest side of the polyline.
You can adjust the HPNAME pattern as well as HPSCALE if these do not suit you.

Message 12 of 18

fieldguy
Advisor
Advisor

What's the purpose of using the action recorder?  You can create a script to run a batch process if that is required. 

0 Likes
Message 13 of 18

ChicagoLooper
Mentor
Mentor

@Sander_Va wrote

<<... i need to hatch closed polylines. there are 2 separate layers in each drawing that needs to be hatched in a different color/pattern...>>

 

Since you need two separate colors/hatch patterns, can you explain the criteria that determines which polyline gets THIS hatch and which gets THAT hatch?

 

Would it be possible to upload a sample of your polygons and any 'data' that is associated with each polygon.

 

Chicagolooper

EESignature

0 Likes
Message 14 of 18

АлексЮстасу
Advisor
Advisor

"P" can be seen as a pre-selected one. If there was no preselected one before running the macro, or if non-closed objects were preselected, no hatching will be created.

 

When creating a macro, after entering _ALL, you must enter Enter 3 times:
1. Confirmation of _ALL.
2. Confirmation of the selection ("Selected 15").
3. Completion of parameter definition/performance of hatching.

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

0 Likes
Message 15 of 18

Sander_Va
Explorer
Explorer

Hi,

 

This file has the hatches i want it to have.

(I hatched these manually)

0 Likes
Message 16 of 18

Sander_Va
Explorer
Explorer

Hi,

 

I tried to follow the order of operation and then when i replay the record this screen appears:

0 Likes
Message 17 of 18

O_Eckmann
Mentor
Mentor
Accepted solution

Hi @Sander_Va ,

 

No problem for me with macro recorder. Here is screencast :

I join macro file ATCM

 

Olivier Eckmann

EESignature

0 Likes
Message 18 of 18

Sander_Va
Explorer
Explorer

Thanks, 

 

This seems to work! 

0 Likes