• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

problem lisp in english version to recreate multiple contours

athanatos

Guest
Good morning, everyone!

I open this topic to ask for information on several network lisp that should allow to recreate the contours of more retinals.

one of the many is this

;handy autocad-12 hatch edit 06/08/2009
;author: alex borodulin
;nyacad, inc. http://www.nyacad.com
(defun c:has(/ gp) (setq gp (ssget))(command "-hatchedit" gp "as" pause));convert hatch to associative
(defun c:hbo(/ gp) (setq gp (ssget))(command "-hatchedit" gp "b" "p" "y"));add boundary to hatch
(defun c:hf(/ gp) (setq gp (ssget))(command "-hatchedit" gp "o" "s" pause "n"));hatch fix
(defun c:hs(/ gp) (setq gp (ssget))(command "-hatchedit" gp "h"));hatch separate

oppure questo reperibile qui
http://forums.autodesk.com/t5/visua...olygons-each-in-the-layer/td-p/3275725/page/1the problem of these codes is that they probably work with the English versions of autocad.

In fact (in autocad 2013) the command "-hatchedit" in Italian becomes "_hatchedit". I can't find a match for the b p y commands.

Does anyone have a solution to propose or working lisp?

Thanks again for the help.

greetings
 
you have to put the underscore in order to make them "interpret in Italian".
Code:
[COLOR=#333333];handy autocad-12 hatch edit 06/08/2009[/COLOR][COLOR=#333333];author: alex borodulin[/COLOR][COLOR=#333333];nyacad, inc. [/COLOR][URL="http://www.nyacad.com/"]http://www.nyacad.com[/URL][COLOR=#333333](defun c:has(/ gp) (setq gp (ssget))(command "_-hatchedit" gp "_as" pause));convert hatch to associative[/COLOR][COLOR=#333333](defun c:hbo(/ gp) (setq gp (ssget))(command "_-hatchedit" gp "_b" "_p" "_y"));add boundary to hatch[/COLOR][COLOR=#333333](defun c:hf(/ gp) (setq gp (ssget))(command "_-hatchedit" gp "_o" "_s" pause "_n"));hatch fix[/COLOR][COLOR=#333333](defun c:hs(/ gp) (setq gp (ssget))(command "_-hatchedit" gp "_h"));hatch separate[/COLOR]
 
b = boundary (replaceable from _b)
p = polyline (I believe it is identical between eng and ita)
y = yes (serve an explanation? )

in all cases follow the command line and view the command options in Italian
or alternatively, you'll have an underscore both at the controls and options and see if it goes
 
thanks to both for the help.

I tried to use the low dash solution and it actually works.

My problem is, however, linked to the tyration of the operation on many networks: In fact I just exported from qgis a series of samplings that in the dxf file do not have the contour. I must therefore provide to recreate the contour of hundreds of samples.

the previous lisp allows to recreate it but by manually clicking each sample... I'm looking for a solution because autocad does it automatically.

this list (from the second link) seems to do to my case (correct me if I'm wrong)
;;;recreate-hatch-boundaries.lsp written by murray clack, november 19, 2010
;;;this routine will recreate boundaries around multiple selected hatch patterns and makes the patterns associative
(prompt "\nhatch-recreate-boundaries.lsp loaded, enter 'hatch_recreate_boundaries' to execute")
(defun c:hatch_recreate_boundaries (/ oldce sset cnt obj)
(setq oldce (getvar "cmdecho"))
(setvar "cmdecho" 0)
(princ "\nselect hatch objects: ")
(setq sset (ssget))
(setq cnt -1)
(while (setq obj (ssname sset (setq cnt (1+ cnt))))
(command "_-hatchedit" obj "_b" "_p" "_y")
(command "_change" cnt "p" "la" "defpoints" "")
)

(setvar "cmdecho" oldce)
(princ)
)
putting the only down in front of hatchedit and the three letters (whose Italian correspondents are r, for recreation, p, for polylinea, s, for si) does not work automatically (there is no iteration).

Any idea?

greetings and thanks again for the courtesy.
 
Good morning.
I'm self-responsive.

I read the list and realized that the code recreated the boundary polyline and then changed layers (puting it in defpoints, with the _change instance). I just deleted the code line for this event and the code worked perfectly!

here is therefore the list working (proven on autocad 2013)
;;;recreate-hatch-boundaries.lsp written by murray clack, november 19, 2010
;;;modificato dall'utente athanatos nel forum cad3d, luglio 21, 2016
;;;this routine will recreate boundaries around multiple selected hatch patterns and makes the patterns associative
(prompt "\nhatch-recreate-boundaries.lsp caricato, scrivere 'hrb' per eseguire")
(defun c:hatch_recreate_boundaries (/ oldce sset cnt obj)
(setq oldce (getvar "cmdecho"))
(setvar "cmdecho" 0)
(princ "\nselect hatch objects: ")
(setq sset (ssget))
(setq cnt -1)
(while (setq obj (ssname sset (setq cnt (1+ cnt))))
(command "_-hatchedit" obj "_b" "_p" "_y")
)

(setvar "cmdecho" oldce)
(princ)
)
Try it just to be sure. Thanks again for the help,

greetings and good work
 
Last edited:

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.

Back
Top