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

select items and add extended files

  • Thread starter Thread starter Angelo2449
  • Start date Start date

Angelo2449

Guest
Hello everyone,
I have before me an open design with different elements, I would like to select only the circles of red color and attack to these different, I say, records however of data strings.

I read that you can get this result through extended files, I know little about it, I look for help!

p.s: I started with this: (setq a (ssget "_x"((0 . "circle")))))

Thank you.
 
start with this:
(setq red_circle (ssget "_x" ((0 . "circle")(62 . 1)))))

or queto if you want to associate more types of element
(setq red_circleorline (ssget "x"((-4). "<or") "circle")(0="" "line")(-4="" "or="" (0="" .="">(62 . 1))</or")>
 
Thank you.
from how I understood "ssget" it deals with selecting all red color (62.1).
I imagine education creates the group "red_circle"
Now, to the elements of the group, I have to associate strings of the type "name", "coordinated", ......
I would like that by selecting an entity of the created group, it can have the associated strings back.
This second part is clearer to me, the first....
Thank you.
.
 
the file <xdata testo.lsp=""> contains two basic functions to insert or read a string from "extended files" or preferably called xdata.

(if (not (tblsearch "appid" "miaapp"))
(regapp "miaapp")
)
this serves to define the name of the application to which the two functions will refer; is also the name of the app stored in entities; multiple apps can add data to the same entity. for now do not miss us too much time and parts from this assumption, with the practice will be easier.

(addxdataname entity stringaditesto)
recalling the function and passing the two parameters you will store the string.

(setq text)
store in the variable text the content of xdata.

these routines are made to write or read only one string of text; you can expand the amount of data to multiple strings, numbers, coordinates, etc.

bye</xdata>
 

Attachments

thanks rpor66,
I read your files, I had just written these
Code:
(defun c:crext (/)

(seq group)

(group regapp)

(setq oldlist (entget (entsel)))

)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

(defun c:definisciext (/)

(setq oldlist (entget (entsel)))

;(setq thedata '(-3 ("afralisp" (1000 . "kenny is handsome") (1000 . "and intelligent")))))))
(setq thedata '((-3 (group (1000 . "first") (1000 . "second")))))))

(entmod newlist)

)

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

(defun c:estraiext (/)

(setq elist (entget (entsel))))

)
My problem is to select all entities (red circles) present in the dwg with the program "definisciext".
Thank you.
 
I neglected to say that the strings to associate (defined first and second in the program) are present in the dwg next to the red circles (they were defined by a "dxf")
So I should extract from the string, the substrings.
I think the best thing is to include in the string the coordinates of the circle, then select the strings instead of the circles.
or extract the coordinates of the circle knowing its position regarding the string or the opposite.
if I arrive at the multiple selection of entities, I think it is then quite simple (!).
Thank you.
 
the file <xdata testo.lsp=""> contains two basic functions to insert or read a string from "extended files" or preferably called xdata.

(if (not (tblsearch "appid" "miaapp"))
(regapp "miaapp")
)
this serves to define the name of the application to which the two functions will refer; is also the name of the app stored in entities; multiple apps can add data to the same entity. for now do not miss us too much time and parts from this assumption, with the practice will be easier.

(addxdataname entity stringaditesto)
recalling the function and passing the two parameters you will store the string.

(setq text)
store in the variable text the content of xdata.

these routines are made to write or read only one string of text; you can expand the amount of data to multiple strings, numbers, coordinates, etc.

bye</xdata>
thanks rpor66,
I continued to try to write the right code and came to this:
Code:
    (defun c:creaextgruppo (/ ttt)

        (setvar "osmode" 0)

        (setq oggetto "gruppo")
        (regapp oggetto)
        (setq ttt (ssget "_x" '((0 . "text,mtext")(1 . "p*"))))

        (repeat (setq n (sslength ttt))
            (setq tt (ssname ttt (setq n (1- n))))

            (setq string (entget tt))
            (setq txt1 (assoc 1 string))
            (setq txt1 (cdr txt1))
            (setq lungh (- (strlen txt1) 60))

            (setq cxy (assoc 10 string))
            (setq cox (cadr cxy))
            (setq coy (caddr cxy))
            ;(command "_erase" tt "")
            (setq coox (rtos cox))
            (setq cooy (rtos coy))
            (setq indirizzo (strcat coox "," cooy))

            (setq nomepunto (substr txt1 2 lungh))
            (setq ecef (substr txt1 (+ 3 lungh) 34))
            (setq gaussboaga (substr txt1 (+ 38 lungh) 23))
            (setq oldlist (entget tt))

            (setq thedata '((-3 (oggetto (1000 . nomepunto) (1000 . ecef) (1000 . gaussboaga)))))

            (setq newlist (append oldlist thedata))
            (entmod newlist)
        ); repeat
    ); defun
There is something wrong because when it comes to education "(entmod newlist)" I get the error message: "; error: wrong dxf group: (-3 (1000 . point name) (1000 . ecef) (1000 . gaussboaga)))"

Thank you.
 
(setq thedata (list -3 (cons 1000 point name) (cons 1000 ecef) (cons 1000 gaussboaga))))

so it should go.

strive to assign the variable names that identify the content:
(setq tt (ssname ttt (setq n (1- n)))) ssname returns the name of the entity, nomeentita is preferable
(setq string (entget tt)) maybe it would be better (setq entityta (entget tt)), string seems to contain text

Good job
 
I applied your suggestions, it's all right up to the last line (entmod newlist)
Code:
(defun c:creaextgruppo (/ ttt)

        (setvar "osmode" 0)

        (setq oggetto "gruppo")
        (regapp oggetto)
        (setq stringa (ssget "_x" '((0 . "text,mtext")(1 . "p*"))))

        (repeat (setq n (sslength stringa))
            (setq entita (ssname stringa (setq n (1- n))))

            (setq str (entget entita))
            (setq txt1 (assoc 1 str))
            (setq txt1 (cdr txt1))
            (setq lungh (- (strlen txt1) 60))

            (setq cxy (assoc 10 str))
            (setq cox (cadr cxy))
            (setq coy (caddr cxy))
            ;(command "_erase" entita "")
            (setq coox (rtos cox))
            (setq cooy (rtos coy))
            (setq indirizzo (strcat coox "," cooy))

            (setq nomepunto (substr txt1 2 lungh))
            (setq ecef (substr txt1 (+ 3 lungh) 34))
            (setq gaussboaga (substr txt1 (+ 38 lungh) 23))
            (setq oldlist (entget entita))

            (setq thedata (list -3 (list oggetto (cons 1000 nomepunto) (cons 1000 ecef) (cons 1000 gaussboaga))))

            (setq newlist (append oldlist thedata))
            (entmod newlist)
        ); repeat
    ); defun
Thanks again.
 
Now it does not make any mistake but external references are not added, the question of the point with :
Code:
(defun c:estraiext (/)

(setq elist (entget (car)))

)
returns this:

select object: ((-1 . <nome 18a2e4fde90="" entità:="">) (0 . "text") (330 . <nome 18a2e4fcef0="" entità:="">(i) (i) (i) (i) (i) (i)) (ii) (ii) (i) (i) (i)) (i) (i) (ii) (i) (i) (i)) (i) (i)) (i) (i) (i) (i)) (i) (i)) (i) (i) (i)) (i) (i) (i)) (i) (i) (i) (i) (i) (i) (i) (i) (i)) (i) (i) (i)) (i) (i) (i) (i) (i)))) (i) (i) (i)) (i) (i) (i) (i))) (i) (i) (i) (i) (i) (i) (i) (i)))))))) (i) (i) (i) (i) (i) (i) (i) (i) (i) (i) (i) (i) (i)))

as you see item 1000 does not appear, much less "group".
</nome></nome>
Code:
(defunc c:creaextgroup (/ ttt)

(Setvar "osmode" 0)

(seq object "group")
(regapp object)
(setq string (ssget "_x"(0 . "text,mtext")(1 . "p*")))))

(repeat (setq n (sslength stringa))
(setq entityta (ssname stringa (setq n (1-n)))))

(setq str (entget entita))
(setq txt1 (assoc 1 str))
(setq txt1 (cdr txt1))
(setq lungh (- (strlen txt1) 60)

(setq cxy (assoc 10 str))
(setq cox)
(setq coy (caddr cxy)
;(command "_erase" set")
(setq coox (rtos cox)
(setq cooy (rtos coy)
(setq address (strcat coox "," cooy))

(setq point name (substr txt1 2 lungh))
(setq ecef (substr txt1 (+ 3 lungh) 34))
(setq gaussboaga (substr txt1 (+ 38 lungh) 23)
(setq oldlist (entget entita))

(setq thedata (list -3 (cons 1000 point name) (cons 1000 ecef) (cons 1000 gaussboaga))))

(setq newlist)
(entmod newlist)
); repeat
);
I'll never stop thanking you!
 
Sorry for the absence, mess with new pc, a bit of loser never fails.
to evaluate the validity of the routine you must attach a branch of the dwg you use.
bye
 
Hello rpor66 and hello to all,
reading and rereading the code and always learning a little more, I corrected the programs, and now, everything seems to work as I wanted.
Group creation code > > :
Code:
(defun c:creaextgruppo (/ ttt)

        (setvar "osmode" 0)

        (setq oggetto "gruppo")
        (regapp oggetto)
        (setq stringa (ssget "_x" '((0 . "text,mtext")(1 . "p*"))))

        (repeat (setq n (sslength stringa))
            (setq entita (ssname stringa (setq n (1- n))))

            (setq testo (entget entita))
            (setq txt1 (assoc 1 testo))
            (setq txt1 (cdr txt1))
            (setq lungh (- (strlen txt1) 60))

            (setq nomepunto (substr txt1 2 lungh))
            (setq ecef (substr txt1 (+ 3 lungh) 34))
            (setq gaussboaga (substr txt1 (+ 38 lungh) 23))
            (setq oldlist (entget entita))

            (setq thedata (list -3 (list oggetto (cons 1000 nomepunto) (cons 1000 ecef) (cons 1000 gaussboaga))))

            (setq newlist (append testo (list thedata)))
            (entmod newlist)
        ); repeat
    ); defun
Data extraction code attached to the group >>> :
Code:
(defun c:estraiext (/)

(setq lista (entget (car (entsel)) '("group")))
(setq xlist (assoc -3 lista))
(setq txtdata (car (cdr xlist)))
(setq nomepunto (cdr (nth 1 txtdata))
(setq ecef (cdr (nth 2 txtdata))
(setq gaussboaga (cdr (nth 3 txtdata))

(princ "\n")
(princ nomepunto)
(princ "\n")
(princ ecef)
(princ "\n")
(princ gaussboaga)
(princ "\n")

)
I'm sure I'll still need you all, thank you.
 
I checked using dwg and lisp from you created, it works.
I have not understood, however, the meaning, to associate with the text of the information already contained in the text; Do you have to associate them with the circles?
store coordinates as strings, using the 1011 you can store it as a coordinate.
This is a summary of usable codes:;data type code description
;string 1000 a string of up to 255 characters.
;application name 1001 an application name.
;layer name 1003 the name of a layer.
;database handle 1005 the handle of an entity.
;3d point 1010 a 3d coordinate value.
;real 1040 a real value.
;integer 1070 a 16 bit integer (signed or unsigned).
;long 1071 a 32 bit signed (long) integer.
;control string 1002 a control code to set off nested list.
;world space position 1011 a 3d coordinate point that is moved, scaled rotated, streched and mirrored along with the entity.
;world space displacement 1012 a 3d coordinate point that is scaled, rotated or mirrored along with the entity. it cannot be stretched.
;world space direction 1013 a 3d coordinate point that is rotated or mirrored along with the entity. it cannot be scaled, streched or moved.
;distance 1041 a real value that is scaled along with the entity. used for distance.
;scale factor 1042 a real value that is scaled along with the entity. used as a scale factor.

bye
 
I have followed your suggestion, now I extract the flat coordinates from the selection but I cannot change the selected text, :
Code:
(defun c:puntogp (/ object string n entita lxt1 lungh thedata newlist np)

(Setvar "osmode" 0)
(Section 0)

(seq object "group")
(regapp object)
(setq string (ssget "_x"(0 . "text,mtext")(1 . "p*")))))

(repeat (setq n (sslength stringa))
(setq entityta (ssname stringa (setq n (1-n)))))

(Sectq text)
(setq txt1 (assoc 1 text))
(setq txt1 (cdr txt1))
(setq lungh (- (strlen txt1) 36)
(setq xyz (assoc 10 text)
(Sectq primed??? ? ? ? ? ? )

(princ "text > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 
(princ text)
(princ "\n")
(princ "txt" > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > "
(princ txt)

(setq gaussboaga (strcat (rtos (cadr xyz)) "," (rtos (caddr xyz))))
(princ gaussboaga)
(princ "\n")
(princ text)
(princ "\n")

(setq point name (substr txt1 2 (- lungh 1)))
(princ point name)
(princ "\n")
(setq ecef (substr txt1 (+ 2 lungh) 35))
(princ ecef)
(princ "\n")
(setq controllerstz.)
(setq controllerpt.)

(setq oldlist (entget entita))
(setq thedata (list -3 (cons 1000 point name) (cons 1000 ecef) (cons 1000 gaussboaga) (cons 1000 controllerstz)))
(princ 'thedata > > > > > > > > > > > > > > > > > )
(princ thedata)
(princ "\n")
(princ "----------------------)
(princ "\n")

(setq newlist)
(entmod newlist)

(command "_change" primed """ """ """ """ """ """ """ """" """" """" """" """" """"" """"" """"" """"" """"" """"""""" """"""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
);repeat

(Section 1
(command "_style" "arial" "arial.ttf" 0 1 0 "")
(alert "relief setting performed")

);
I put some questions where I'm teaching.
Thank you.
 
problem solved!
This is the new code:
Code:
(defun c:puntogp (/ object string n entita lxt1 txt2 lungh thedata newlist np)

(Setvar "osmode" 0)
(Section 0)

(seq object "group")
(regapp object)
(setq string (ssget "_x"(0 . "text,mtext")(1 . "p*")))))

(repeat (setq n (sslength stringa))
(setq entityta (ssname stringa (setq n (1-n)))))

(Sectq text)
(setq txt1 (assoc 1 text))
(setq txt2 (cdr txt1))
(Sectq lungh (- (strlen txt2) 36)
(setq xyz (assoc 10 text)

(princ "text > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 
(princ text)
(princ "\n")
(princ "txt" > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > "
(princ txt)

(setq gaussboaga (strcat (rtos (cadr xyz)) "," (rtos (caddr xyz))))
(princ "\n")
(princ gaussboaga)
(princ "\n")
(princ text)
(princ "\n")

(setq point name (substr txt2 2 (- lungh 1)))
(princ point name)
(princ "\n")
(setq ecef (substr txt2 (+ 2 lungh) 35))
(princ ecef)
(princ "\n")
(setq cstz "1")
(setq cpt "2")

(setq oldlist (entget entita))
(setq thedata (list -3 (cons 1000 point name) (cons 1000 ecef) (cons 1000 gaussboaga) (cons 1000 cstz)))
(princ 'thedata > > > > > > > > > > > > > > > > > )
(princ thedata)
(princ "\n")
(princ "----------------------)
(princ "\n")

(setq newlist)
(entmod newlist)

(command "_change" entita "" "" "" "" "" "" "" """ """ """ """ """" """ """" """" """" """" """" """" """"" """" """""" """""""" """""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
);repeat

(Section 1
(command "_style" "arial" "arial.ttf" 0 1 0 "")
(alert "relief setting performed")

);
Now I have a new question:
I would like to replace the 4th and 5th element of the list, now defined respectively as "1" and "2" in "ok1" and "ok2".
I have tried this instruction (and many others) but it does not work:
Code:
(defun c:final (/ fc3 control7 check5 list txt1 xlist primed txtdata point ecef gaussboaga control2 fp2)

(if (= primariga nil)
(progn)
(alert "you must first define the initial summit (baseline)")
(exit)
)
)

(setq fc3 (findfile "c:\\\\autocadsupporto\\\note\\\\\nota.dat"))

(if fc)
(vl-file-delete "c:\\\autocadsupport\\\note\\\nota.dat")
)

; --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

(setq control7 nil)
(setq control7 (findfile "c:\\\autocadsupport\\\contatori\\\counter.dat"))

(if (= check7 "c:\\autocadsupport\\\contatori\\\counter.dat")
(progn)
(setq fp4 (open "c:\\\\autocadsupport\\\contatori\\\counter.dat" "r"))
(setq count (read-line fp4))
(setq step (read-line fp4))
(close fp)
)
)

; --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

(setq control5 nil)

(setq control5 (findfile "c:\\\autocadsupport\\\dati\\\datirilievo.dat"))

(if (= check5 "c:\\autocadsupport\\dati\\datirilievo.dat")
(progn)
(setq fp3 (open "c:\\\autocadsupport\\\dati\\datirilievo.dat" "r"))
(setq current date (read-line fp3))
(setq ora1 (read-line fp3))
(setq ora2 (read-line fp3))
(setq pdop (read-line fp3))
(close fp)
)
)

(startapp "c:\\autocadsupporto\\\liberty\\\point.exe "c:\autocadsupport\\\\\\\\point.tkn")

(setq list nil)
(sing)
(= list nil)
(setq list (entget (entsel)) (group))))
)

(princ "\n")
(princ "list > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > )
(princ list)

(setq txt1 (assoc 1 list)
(princ "\n")
(princ txt)
(princ "\n")

(setq nomeentita (assoc -1 list)
(princ "\n")
(princ nomeentita)
(princ "\n")

(setq xlist (assoc -3 list)
(princ "\n")
(princ "xlist > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > "
(princ xlist)
(princ "\n")

(setq primed (car txt1))
(setq txtdata (car))
(princ "\n")
(princ "txtdata > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > "
(princ txtdata)
(princ "\n")

(setq point name (nth 1 txtdata)))
(setq ecef (nth 2 txtdata)))
(setq gaussboaga (nth 3 txtdata)))
(setq controllerstz (nth 4 txtdata)))
(setq controller)

(princ "\n")
(princ point name)
(princ "\n")
(princ ecef)
(princ "\n")
(princ gaussboaga)
(princ "\n")

(Sectq point nil)
(setq notay nil)

(seq control2 nil)

(while (= control2 nil)
(setq control2 (findfile "c:\\\autocadsupporto\\\note\\\\nota.dat"))
)

(setq fp2 (open "c:\\\\autocadsupporto\\note\\\nota.dat" "r"))
(setq point (read-line fp2))
(setq notay (read-line fp2))
(close fp)

(princ "\n")
(princ point)
(princ "\n")
(princ notay)
(princ "\n")

(setq cxp (substr ecef 1 11)
(setq cyp (substr ecef 13 11) ; here 11
(setq czp (substr ecef 24 11)
(setq cxpp (atof cxp)
(setq cypp (atof cyp)
(setq czpp (atof czp))

(princ "\n")
(princ "cxp > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  "
(princ "\n")
(princ cxp)
(princ "\n")
(princ)
(princ "\n")
(princ cyp)
(princ "\n")
(princ)
(princ "\n")
(princ czp)
(princ "\n")

(princ "\n")
(princ "cxbb > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  "
(princ "\n")
(princ cxbb)
(princ "\n")
(princ "cybb > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > "
(princ "\n")
(princ cybb)
(princ "\n")
(princ "czbb > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > "
(princ "\n")
(princ czbb)

(setq diffx (* -1 (- cxbb cxpp)))
(setq diffy (* -1 (- cybb cypp)))
(setq diffz (* -1 (- czbb czpp)))

(setq diffxx (rtos diffx)
(setq diffyy (rtos diffy)
(setq diffzz (rtos diffz)
(setq xxyyzz (strcat diffxx "," diffyy "," diffzz))

(setq note2 (strcat name " - " notay " - " point))
(setq line (strcat "2|" point "|" xxyyzz "|0,0,0,0,0,0|pdop=" pdop "|0.000" note2 "|"))

(setq fp1 (open "c:\\\autocadsupport\\\\librettopregeo.dat" "a"))
(write-line line fp1)
(close fp)

;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

(command "_circle" gaussboaga "0.15")
(setq newtext (strcat " point " - " point name))
(command "_change" primed """ """ """ newtext)

(princ "\n")
(princ "count > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  "
(princ count)
(princ "\n")
(princ "pass > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > )
(princ step)
(princ "\n")
(princ > > > > > > > > > > > > > > > > > > > > > > > > > > > > )
(princ point)
(princ "\n")

(setq count1)
(setq pointn)

(if (= pointn (+ count1) (too)))
(progn)
(setq count2 (+ count1 10))
(setq count3 (itoa count2)
)
(setq count3 count)
)

(setq fp4 (open "c:\\\\autocadsupport\\\contatori\\\counter.dat" "w"))
(write-line count3 fp4)
(write-line step fp4)
(close fp)

(setq index (strcat index point name))

; --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

(subst "ok" xlist control)
(subst "ok" xlist control)
(entmod list)

; --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

(alert "dates of the final summit saved")

) final procedure
the lines (subst "ok" controlstz xlist) and (subst "ok" xlist control) have been subject to countless variations, no change the 4th and 5th element respectively (1000 . 1) and (1000 . 2).
Thank you.
 
(setq list (subst (cons 10 newpt) (cons 10 oldpt) list)
this is the syntax to use in replacement.
As soon as I have a moment, I see you posting your program code.
 
thanks rpot66,
as always!
in the last code I posted, there is the function
Code:
 (setq newtext (strcat " point " - " point name))
(command "_change" primed """ """ """ newtext)
that should change the existing string content with the new one, should because, after a period in which it worked, now it does not work anymore, I did not change the code!
I want to change the string content and not replace it to not lose the extended data associated with it,
As an alternative, I could replace it with the new one and associate it with the extended data.
I find, if it works, easier to change and maintain.
Thank you, angel2449.
 

Forum statistics

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

Members online

No members online now.
Back
Top