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

insert retinals into the cathartic maps

  • Thread starter Thread starter Claudio B.
  • Start date Start date

Claudio B.

Guest
I'm trying to learn how to program in lisp, but I can't find documentation on certain commands.
there is some who knows why the following rutine does not work:
;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(defun colora ()
(setq bc)
(laughs)
(list)
'(0 . "polyline") ;filtrate polylines;
'(62 . 1) ;filter red colour;
(cons '8 "manufactured") ;filtra layer; ;
)
)
(command "draw" "ansi31" "20" "0")
(princ)
)
;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
the goal is to insert a retino (or a color) for all the buildings present on the map sheets (I give an example).
Thank you all.
 

Attachments

What are the commands you don't find documentation and where you haven't found any help?
some suggestions:
1
(cons '8 "manufactured") ;filtra layer; ;
replace with
(cons 8 "made") ;filtra layer

2nd
you must slide all the elements of the selection and apply to each of them the dash (with a cycle for or while or repeat)

3rd
change the dash line (you must introduce the selection of an object or point, here more complicated)

4th
attentive to the Italian/English version regarding the commands and their options.

Good job
 
in addition to what suggested by joseph antepose * to polyline so as to capture also lwpolyline (you might get maps with this type of entity) and be careful about the color filter, your buildings are dalayer color, not red.
HTML:
(defun c:colora (/bc_rt cont sel)
(setq bc_rt (ssget "_x"
(list
'(0 . "polyline") ;filtra le polilinee
;;;'(62 . 1) ;filtra colore rosso
(cons 8 "fabbricati");filtra layer; ;
)
)
)
(setq cont -1)
(repeat (sslength bc_rt)
(setq sel (ssname bc_rt (setq cont (1+ cont)))))
(command "_-bhatch" "_s" sel ""_p" "ansi31" "20" "0"")
)
(princ)
)
(cons '8 "manufactured") ;filtra layer; ;
replace with
(cons 8 "made") ;filtra layer
It works equally. :smile:
 
Thank you all for the attention.
Joseph,
I have the Italian version. I couldn't find, in the various manuals I downloaded on the lisp, how to apply "command" to the various autocad commands; what I wrote was an attempt copied from a previous discussion.

gp;
is perfect, it works egregiously; I also tried this variant:
(command "_-bhatch" "_s" sel "_p" "solid" "" "")
It works, but I don't know how to assign color 254 to the dash.
 
.... I don't know how to assign color 254 to the dash.
methods are different, you can set the cecolor variable, or stream a layer with color 254 before launching the lisp, or still change the color to the newly created retinals by inserting (command "_chprop" "_l" "_c" "254"") just under the dash command.
 
thanks gp; so it works.
Sorry I'm late in the answer, but the job doesn't leave me much time.

the final goal is that, through a single command to create pdf prints of the cathartic maps. also to be able to insert the xrifs of maps to form pictures of set (disactivating the laier titles).

after several attempts I managed to make the attached code work; almost everything goes well, but they are to perfect the following points:
1) the scale setting does not produce the desired results, why?
2) how to change the layer on which the lines of block 3 are deficient?

Unfortunately I still do not know the language well, but with your help perhaps you can make a utility that can serve many.
 

Attachments

Why do you set up a new layout?

Block 3 lines are on the "simboli" layer, what do you want to change?
 
the map sheets that I will have to treat are about 1600, I wanted to find a fast system to create pdfs to share on the company network, cumunque the problem of the correct scale is not important, is that I can not understand the behavior of the program.

for bolocco 3, I need the lines defined there to be repositional on the "titles" layer so that by turning said layer I can create union designs without frames, titles, and high entities that disturb.
 
p.s. - I entered a new layout, model, because I have not yet managed to find a sitema to configure, in lisp, the default layout.
I normally use a totally different configuration (plotter, paper size, color style, etc.)
 
....for bolocco 3, I need the lines defined there are repositional on the "titles" layer. ...
(setq blk (tblsearch "block" "3))
(setq ent (cdr (assoc -2 blk)))
(while int
(setq ent1 (entget ent))
(entmod (subst (cons 8 "titoli") (assoc 8 ent1))
(setq ent (entnext ent))
)
(command "_regen")



curiosità, (if you could say so) does not fate in agenzia dei pdf delle mappe?
 
thank you gp, you are precious: I loaded everything and finally start to see the results hoped.

ps.: pdf files are visible (and used) by all, something not possible for dwf.
 
Excuse me if I interfere with the two greats of the lisp.
The only thing I have to add for claudio is to be careful that the selected polylines are closed.

In the case of the dwg posted it was so, but if any of them were not closed, the results of the object selection process would have been quite unpredictable.

a greeting to the two big lisp:smile:
 
Jew,
gp is a big one, unfortunately I am still at first arms.

see one of my previous posts; the specification for the map sheets provided by the catasto (see ute.zip).
until now, for the dxf provided by the agency of the territory, in the manufactured layer there were only closed polylines; but it is true, there may be abnormal cases.
 

Forum statistics

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

Members online

No members online now.
Back
Top