Hi all,
I am trying to write a lisp routine that will make a layer called hatch, set it as current and then run the hatch command.
BUT the hatch command is not bring up the hatch dialogue box, it just puts things on the command line.
The layer is being made & set current.
The lisp is as follows:
(defun c:hh (/ ec)
(setq ec (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "-layer" "m" "hatch" "c" "8" "" "l" "continuous" "" "s" "hatch" "")
(command "hatch")
(setvar "cmdecho" ec)
)
Any help would be appreciated.
On another matter, I have just found the bevel lisp routine by Terry Miller which works great BUT only for imperial measurements. I would like to know if anyone knows of a similar routine, or how to make Terry's metric, that will work for metric measurements.
Regards
JohnB
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
@Anonymous wrote:....
I am trying to write a lisp routine that will make a layer called hatch, set it as current and then run the hatch command.
BUT the hatch command is not bring up the hatch dialogue box, it just puts things on the command line.
....
Try:
(initdia)
(command "_.bhatch")
If you want to create hatch without picking
the inner point and change the hatch properties,
see -hatchedit command, e.g.:
(defun c:hh (/ cts ec ent)
(setq ec (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "-layer" "m" "hatch" "c" "8" "" "l" "continuous" "" "s" "hatch" "")
(setq cts (ssget ":S" (list (cons -4 "<or") (cons -4 "<and")(cons 0 "lwpolyline")(cons 70 1)(cons -4 "and>")
(cons 0 "circle")
(cons -4 "or>")))); <-- chage filter to suit
(setq ent (ssname cts 0)) (command "_.-hatch" "_p" "_solid" "_s" ent "" "")
(command "_.-hatchedit" "_l" "" "_p" "ansi32" "0.25" "90")
(setvar "cmdecho" ec)
(princ)
)
~'J'~
Thanks Kent.
I thought I had tried all the combinations of _ - . hatch & bhatch must have missed that one.
Perfect!!!!
OK, now for your next challenge:
In lieu of setting to another layer without user knowledge, and
leaving him on that layer when finished, one can use the
CHPROP "Last" option to direct the newly created object to
the desired layer and everyone will be happy.
This will involve the following:
(if not TBLSEARCH "Layer"
create layer
thaw or turn on layer
);if
ENTMOD, and SSGET "Last",
or just use CHPROP for these last two.
???
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.
Scot,
Further to your suggestion for the hatch lisp, is there any way for this to happen with dimensions.
At the moment I have the macros set as follows:
^c^c-layer make dim colour 7;-colour bylayer^C^C_dimaligned
This works for placing the dimensions on the dim layer but it would be nice if it would
revert to the previous layer setting
Regards
JohnB
Can't find what you're looking for? Ask the community or share your knowledge.