Make hatch with a special layer ......... ????

Make hatch with a special layer ......... ????

Anonymous
Not applicable
335 Views
5 Replies
Message 1 of 6

Make hatch with a special layer ......... ????

Anonymous
Not applicable
Hello up there,

Here is the problem:

I have one aktive Layer (f.e. Layer "Help")
Then I want to draw hatch. Exec the command "Hatch".
I that case, AutoCAD should change the actual Layer to "Hatch" (special
layer for hatch)
After I make my hatch, I want my layer (before doing hatch) back, as actual
(in that case "Help")

When I try to make this in a tool box, I only can make a hatch once and then
the command exit .......

Is there a lisp for my problem .... I think it`s very helpfull for other
users .............

please, help me

Thanks a lot , .................. Matthew
0 Likes
336 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
Matthew, I don't know how much vba you know, but this would be an easy task
for a macro. It might look something like this:

Sub HatchLayer()
Dim sLayer As String
'first get current layer
sLayer = ThisDrawing.GetVariable "CLAYER"
'set the hatch layer
ThisDrawing.SetVariable "CLAYER" "HATCH"
'
'do the hatch thing here......
MsgBox "make your hatch...you will need to write the code for this
part!"
'set layer back
ThisDrawing.SetVariable "CLAYER" sLayer
MsgBox "Done. Have a nice day."
End Sub

'
"Matthew $" wrote in message
news:3BDB9C2BCAFB92A45DDE669482AB3E70@in.WebX.maYIadrTaRb...
Hello up there,

Here is the problem:

I have one aktive Layer (f.e. Layer "Help")
Then I want to draw hatch. Exec the command "Hatch".
I that case, AutoCAD should change the actual Layer to "Hatch" (special
layer for hatch)
After I make my hatch, I want my layer (before doing hatch) back, as actual
(in that case "Help")

When I try to make this in a tool box, I only can make a hatch once and then
the command exit .......

Is there a lisp for my problem .... I think it`s very helpfull for other
users .............

please, help me

Thanks a lot , .................. Matthew
0 Likes
Message 3 of 6

Anonymous
Not applicable
Hi Matthew!

Why don't you use the AutoCAD Menu to do this - you need no LISP or VBA to
do this!

[_Button("HATCH", "ICON.bmp",
"ICON_16_BLANK")]*^C^C_-layer;_n;hatch;;_-bhatch;_p;ansi31;1;0;\;_change;_l;
;_p;_la;hatch;;

Put this line into a toolbar
(You can use the TOOL-Editor or write it directly into your MyMenu.MNS . )
Don't hesitate to write me if you have problems with the menu.

* ... means : no ending call of this line
^c^c ... means : end any running commands
-layer ... means : change layer with NO dialog box
n ... means : new layer (so you can be shure, that layer exists; no
problem if layer existed before)
hatch ... means : name of new layer
-bhatch ... means : command hatch with NO dialog box
p ... means : properties
ansi31 ... means : name of hatch ( you can substitute this with your
favorite hatch)
1 ... means : scale of hatch
0 ... means : rotation of hatch
\ ... means : wait for userinput (pick inside)
change ... means : command change with NO dialog box
l ... means : last (created object)
p ... means : properties
la ... means : layer (change the layer-property of the last object)
hatch ... means : name of layer on which the hatch should be

If you have an english version of autocad, you can leave the underscores
( _ )

With greetings from AUSTRIA
Ing. B. Miksch
www.artandaction.at

Matthew $ schrieb in im Newsbeitrag:
3BDB9C2BCAFB92A45DDE669482AB3E70@in.WebX.maYIadrTaRb...
> Hello up there,
>
> Here is the problem:
>
> I have one aktive Layer (f.e. Layer "Help")
> Then I want to draw hatch. Exec the command "Hatch".
> I that case, AutoCAD should change the actual Layer to "Hatch" (special
> layer for hatch)
> After I make my hatch, I want my layer (before doing hatch) back, as
actual
> (in that case "Help")
>
> When I try to make this in a tool box, I only can make a hatch once and
then
> the command exit .......
>
> Is there a lisp for my problem .... I think it`s very helpfull for other
> users .............
>
> please, help me
>
> Thanks a lot , .................. Matthew
>
0 Likes
Message 4 of 6

Anonymous
Not applicable
Hi Ing.,
wouldn't that need to be 'm' instead of 'n' ? eg:
"*^C^C_-layer;_m;hatch...etc."
(New will create a new layer but not set it current, Make will set it
current)
at least that's what happens on my machine.
Mark

Ing. B. Miksch wrote in message
news:2AD59AA170B6AEB2D1ECECA55BE5D576@in.WebX.maYIadrTaRb...
> Hi Matthew!
>
> Why don't you use the AutoCAD Menu to do this - you need no LISP or VBA to
> do this!
>
> [_Button("HATCH", "ICON.bmp",
>
"ICON_16_BLANK")]*^C^C_-layer;_n;hatch;;_-bhatch;_p;ansi31;1;0;\;_change;_l;
> ;_p;_la;hatch;;
>
> Put this line into a toolbar
> (You can use the TOOL-Editor or write it directly into your MyMenu.MNS
. )
> Don't hesitate to write me if you have problems with the menu.
>
> * ... means : no ending call of this line
> ^c^c ... means : end any running commands
> -layer ... means : change layer with NO dialog box
> n ... means : new layer (so you can be shure, that layer exists;
no
> problem if layer existed before)
0 Likes
Message 5 of 6

Anonymous
Not applicable
Hi Mark

It's my intend NOT to set the layer but be shure that it exists.
At the end of the line the last object is changed to layer 'hatch'
The current layer is never changed in this routine.

Bernie

Mark Propst schrieb in im Newsbeitrag:
3454D9AC0EF6661F0687D66DE2AEAEAC@in.WebX.maYIadrTaRb...
> Hi Ing.,
> wouldn't that need to be 'm' instead of 'n' ? eg:
> "*^C^C_-layer;_m;hatch...etc."
> (New will create a new layer but not set it current, Make will set it
> current)
> at least that's what happens on my machine.
> Mark
>
> Ing. B. Miksch wrote in message
> news:2AD59AA170B6AEB2D1ECECA55BE5D576@in.WebX.maYIadrTaRb...
> > Hi Matthew!
> >
> > Why don't you use the AutoCAD Menu to do this - you need no LISP or VBA
to
> > do this!
> >
> > [_Button("HATCH", "ICON.bmp",
> >
>
"ICON_16_BLANK")]*^C^C_-layer;_n;hatch;;_-bhatch;_p;ansi31;1;0;\;_change;_l;
> > ;_p;_la;hatch;;
> >
> > Put this line into a toolbar
> > (You can use the TOOL-Editor or write it directly into your MyMenu.MNS
> . )
> > Don't hesitate to write me if you have problems with the menu.
> >
> > * ... means : no ending call of this line
> > ^c^c ... means : end any running commands
> > -layer ... means : change layer with NO dialog box
> > n ... means : new layer (so you can be shure, that layer
exists;
> no
> > problem if layer existed before)
>
>
0 Likes
Message 6 of 6

Anonymous
Not applicable
Oops, open foot insert mouth! - I didn't look at the whole picture!.
hmmm...these shoes taste a little rancid!?!
Myopic Mark

Ing. B. Miksch wrote in message
news:6A3A07697940FFC9DD4C47D30BDAB56C@in.WebX.maYIadrTaRb...
> Hi Mark
>
> It's my intend NOT to set the layer but be shure that it exists.
> At the end of the line the last object is changed to layer 'hatch'
> The current layer is never changed in this routine.
>
> Bernie
>
> Mark Propst schrieb in im Newsbeitrag:
> 3454D9AC0EF6661F0687D66DE2AEAEAC@in.WebX.maYIadrTaRb...
> > Hi Ing.,
> > wouldn't that need to be 'm' instead of 'n' ? eg:
> > "*^C^C_-layer;_m;hatch...etc."
> > (New will create a new layer but not set it current, Make will set it
> > current)
> > at least that's what happens on my machine.
> > Mark
> >
0 Likes