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

problema con insert

  • Thread starter Thread starter tizianost
  • Start date Start date

tizianost

Guest
hello to all, I have a problem with a part of lisp that creates a block and inserts it in 0.0:

(setq settutto (ssget "x"(-4 . "<or")(0 "insert")(-4="" "or="" "point")(0="" .="">")))
(command "_-block" "design" "0,0" setall "")

(command "_.-insert" "design" "0,0,0" "1" "1" "0")

I do not understand why the block is inserted in 0.37,0.34

Thank you in advance

Hi.
Titian</or")(0>
 
I also tried with

(entmake (list (0. insert) (2 "drawing") (62 7) (8 0) (10 0.0 0.0 0.0) (41 1) (42 1) (43 1) (50 0)))

but I get the following error

; error: wrong function: 0.0
 
I also tried with

(entmake (list (0. insert) (2 "drawing") (62 7) (8 0) (10 0.0 0.0 0.0) (41 1) (42 1) (43 1) (50 0)))

but I get the following error
; error: wrong function: 0.0
in the line
(command "_.-insert" "design" "0,0,0" "1" "1" "0")
Take off a "1".

attentive also to how to insert pairs of values (dotted pair); see an example.
((-1). <entity 7ef03480="" name:="">) (0 . "insert") (330 . <entity 7ef01cf8="" name:="">) (5 . "1f0") (100 . "acdbentity") (67 . 0) (410 . "model") (8 . "0") (100 . "acdbblockreference") (2 . "cer") (10 1207.62 1007.04 0.0) (41 . 1.0) (42 . 1.0) (43 . 1.0) (50 . 0.0) (70 . 0) (71 .
(210 0.0 1.0)</entity></entity>
 
removing a "1" works properly!!!but...why? I can't understand why this works and the other way not....


Are you referring to the fact that I wrote (8 0) instead of (8 "0")?
also putting quotes the result does not change unfortunately... .

Thank you very much
Hi.
Titian
 
look well at the example I have attached to you (8 . "0") (necessary the intermediate point separated from space)
 
Okay. therefore the same speech applies to all other pairs of values or:


(entmake (list (0 . "insert") (2 . "drawing") (62 . 7) (8 . "0") (10 0.0 0.0 0.0) (41 . 1) (42 . 1) (43 . 1) (50 . 0)))

Right?

Thanks again

You can tell me why if I take off a "1" (command "_.-insert" "sign" "0,0,0" "1" "1" "0") works?

Hi.
Titian
 
You won't believe it, but when I add the line

(command "_.-insert" "sign" "0,0,0" "1" "0")

in the main program the malfunction (insertion of the block in 0.37,0.34) manifests itself again....I am desperate!
 
exists the way to exploit through lisp the "blocking converts" feature present in the "enter block"?

Thank you.
Hi.
Titian
 
You won't believe it, but when I add the line

(command "_.-insert" "sign" "0,0,0" "1" "0")

in the main program the malfunction (insertion of the block in 0.37,0.34) manifests itself again....I am desperate!
when I said to remove "1", I also meant the respective double quotes.
 
at the beginning I had removed them but autocad interpreted the "1" as factor of x scale and "0" as factor of y scale (he asked me to specify the angle). I therefore left the quotes that indicate to autocad to use the same value inserted for the x scale also for the y scale.

in my opinion autocad does not correctly interpret the insertion point "0,0,0". I have entered other coordinates but are always misinterpreted. I note, however, that malfunction occurs only in the main program or if I start (from autocad and not via lisp) a function with only code

(defun insertblock()
(command "_.-insert" "sign" "0,0,0" "1" "0")
)

This works nicely. ...
 
I tried so much but nothing to do

(setq p0 (list 0 0 0))
(command "_.-insert" p0 "1" "0")

always puts it in 0.37,0.34,0

the only way I fear is to make the function I was talking about in previous posts
 
as last possibility I thought to insert the block and then move it with this lisp but it is moved practically to the house. . .

(setq seldisegno (ssget "x"(0 . "insert")))))
(command "_move" seldisegno "0.37,0.34" "0,0")


if instead of "0,0" I put 1,1 I end up in 0.00,0.56
If I put 2,2 I end up in 1,2!! ! !

absurdity
 
what it means: to start from autocad the following function:

(defun insertblock()
(command "_.-insert" "sign" "0,0,0" "1" "0")
)

in brackets, the internal line from however error.
 
to not always start all the script during the test I extracted the part of code that gave me problems and I inserted it in a separate funtion called the insert (which I started directly from autocad).

when I removed the famous "1" I only tested the function and not all the script and this worked as soon as I put it in the real program and it just didn't work anymore. I have tried to perform the function several times and sometimes it works not!


to you what error from that function?
 
I have autocad map 2010 and it works...that's what returns me:

command: insertblock
_.-insert type block name or [?] <disegno>: design
unit: mm conversion: 1
specify insert point or </disegno>[puntoBase/Scala/X/Y/Z/Ruota]: 0.0.0
type x scale factor, specify opposite angle or [Angolo/XYZ] <1> 1
type scale factor y <utilizza di="" fattore="" scala="" x="">:
specify rotation angle <0>: 0
command: nil

do you not know how you can fruit in lisp the option "convert in block" in the "crea block" window?

thank you anyway for the availability

Hi.
Titian</utilizza>
 
and here I must stop because I see that the 2 languages (autocad and autocadmap, which I do not know) have different commands.
 

Forum statistics

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

Members online

No members online now.
Back
Top