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

insert line and circle with texts on coordinates

  • Thread starter Thread starter mazzetti68
  • Start date Start date

mazzetti68

Guest
Good evening, everyone!
I created a lsp where I tried to create a combination of texts and forms, which would simplify the copying operation pastes every time, but it does not work, that I become a chaos:(, I was about to give up, but after many searches on the internet, I found nothing:(...apart from this forum:smile:, where I see that we talk about lsp, and there are good people, and maybe someone can help me... . ?
In practice it is to insert three texts, one by the table number and the other by the name of the plan and the other by the date. the first is inside a circle, the second above a line and the third below. I had thought of using the coordinates to create the points, where I then stick line and circle, but it doesn't work. look at the image below to better understand:
Could someone help me realize it?
Thank you so much in advance!immagine.webp
 
hi, yesterday I forgot to attach to you also the code I had tried to do, but with the coordinates I can not move, few I do not know how to use them, in the sense that autocad le da in x, y e z es. (60.0 25.06 0.0)...and in lsp I do not know how to move on plan 2d :(
(setq pointbase (getpoint "\nindicates the positioning point with the mouse: ") ; starting point of the line(setq pbase+15()) ; end point of the line in direction x +15 -----what already the first problem begins, or how do I use the coordinates? ? :confused:in the way to add in x direction, the value 15.. .
(command "line" puntobase pbase+15 "") ;drawn the lina from the base stain to the distant point 15(setq a (pbase+15)) ;simplify the pbase+15 in a(setq pcerchio1 (a+3) ;cree the point of the center of the circle, adding 3 in direction x..anywhere the circle will measure 3 radius, (I know it is not syntactically correct, but to make it understand I hope functions)

the image below shows the size I would like to use and where the points are placed:immagine2.webpGood afternoon to all!
 
(setq pbase+15()) ; end point of the line in direction x +15 -----what already the first problem begins, or how do I use the coordinates? ? :confused:in the way to add in x direction, the value 15.. .

(setq pbasex (nth 0 puntobase))
(setq pbasey (nth 1 puntobase))
(setq pbasez (nth 2 puntobase))
(setq pbase+15 (list (+ pbasex 15.0) pbasey pbasez))
(command "line" puntobase pbase+15 "") ;drawn the lina from the base stain to the distant point 15(setq a (pbase+15)) ;simplify the pbase+15 in a
What is the need to rename a variable? in reality create another, equal to pbase+15



for the rest, once you have seen how to break down the elements of a coordinate (through the nth function), sum the distances through the function (+ aa bb), and fill them with the list function you can do everything you have in mind by simply putting them on the list.
 
Thank you so much crystal!
Now I've succeeded! I would never have found this function alone! thank you very much :))
For the variable, I actually messed up. . .
now for the creation of the "forms" everything works 100% :smile:

but the problem is that I can't place the text, that is, how do I align the text to the left, and tell it to start from a point

For example, for text1, it must be centered, for example in point (a,bb) therefore with the command "_testom" and therefore centered mc (half-centre)

while text2 must start from point (cc,dd), testm, bottom right bd...

you know how I can integrate it when I command mtesto:

(command "_mtext" breaks "0.125" pauses "1"); I must insert the coordinates and the position type mc and bd, but as commands in English

the mc and bd commands are in Italian, you also know what are the correspondents in English, which usually gives me error if I put them in itliano :( ?

thanks in advance
Good afternoon continuation!
 
update:

I found how to start the text from a given point es p2...

(setq p2 (list pbasex1 pbasey1 pbasez))

(command "_mtext" p2 "1" "title")

but the problem always remains, and autocad gives me error:(
 
do not use _mtext (multiline text), but a _dtext (dynamic text), or more easily a _text (you don't have to view it while typing).
mtext provides a typing box (you should pass the two corners), while dtext (testodin in ita) only wants the insertion point.

for ita-eng correspondence remembers that any version of nationalized acad, always accepts commands in English if precedutu by _ (underscore).
so in an acad ita, the command size can be recalled with _trim.

The text setting options are:
Synthetic (left)
right (right)
centered (center)
half (middle)
low becomes bottom
high becomes upper
 
Thanks a lot more crystal! !
now works perfectly the positioning:
(command "_text" "_br" pbase "2" "0" "title") ; I abbreviated bottom right "_br"


However, a different problem arises with a value :

(setq p1 (getpoint "\nindicates the starting point of the panel line: ")
(setq p2 (getpoint "\nindicates the end point of the panel line: ")
(setq p1x (nth 0 pf1))
(setq p1y (nth 1 pf1))
(setq p1z (nth 2 pf1))
(setq p1+6) 0.06) p1y p1z)) ;the problem is that autocad does not recognize me the data "0.06", for example if I insert "0.6" or "60" works, and returns me null value ...in practice the value 0.06 is used to start the distance line 0.06 from the chosen point.

(setq p2x (nth 0 p2))
(setq p2y (nth 1 p2))
(setq p2z (nth 2 p2))
(setq p2-6 (list p2x p1y p1z))

(command "_line" p1+6 p2-6")

someone knows why, and how to solve it?

thanks in advance
and good evening
 
.........
(setq p1 (getpoint "\nindicates the starting point of the panel line: ")
(setq p2 (getpoint "\nindicates the end point of the panel line: ")
(setq p1x) pf1))
(setq p1y (nth 1 pf1)
(foot p1z) pf1))
(setq p1+6 (list(+ p1x 0.06) p1y p1z)) ;the problem is that autocad does not recognize me the data "0.06", for example if I insert "0.6" or "60" works, and returns me null value ...
you typed badly, it is p1 not pf1

(setq p1x) p1))
(setq p1y (nth 1 p1)
(foot p1z) p1))
 
You're right. I ran away from herring while simplifying:(, which in my lsp I made were 5 points, so I didn't stretch too much, but the problem always remains to me:
Code:
(setq p1 (getpoint "\nindicates the starting point of the panel line: ")
(setq p2 (getpoint "\nindicates the end point of the panel line: ")
(setq p1x (nth 0 p1))
(setq p1y (nth 1 p1))
(setq p1z (nth 2 p1))
(setq p1+6) [COLOR="#FF0000"]0.6[/COLOR]) p1y p1z)) 

(setq p2x (nth 0 p2))
(setq p2y (nth 1 p2))
(setq p2z (nth 2 p2))
(setq p2-6 (list p2x p1y p1z))

(command "_line" p1+6 p2-6 "")
with this stretches me line 0.6 and works.
But if I put 0.06 doesn't work anymore. . :
Code:
(setq p1 (getpoint "\nindicates the starting point of the panel line: ")
(setq p2 (getpoint "\nindicates the end point of the panel line: ")
(setq p1x (nth 0 p1))
(setq p1y (nth 1 p1))
(setq p1z (nth 2 p1))
(setq p1+6) [COLOR="#FF0000"]0.06[/COLOR]) p1y p1z)) 

(setq p2x (nth 0 p2))
(setq p2y (nth 1 p2))
(setq p2z (nth 2 p2))
(setq p2-6 (list p2x p1y p1z))

(command "_line" p1+6 p2-6 "")
You know why?
 
you have the inserted osnap, or imposed osmode = 0 before drawing the line and then restoring it to the end, or:

(command "_line" p1+6 "_non" p2-6 ")
 
Thank you very much!
That was the problem!!
I used osmde=0, then since I have always activated them all, active with osmode=16383, where the sum of the various corresponding numbers you want to activate: none1 endpoint2 midpoint4 center8 node16 Quadrant32 intersection64 insertion128 perpendicular256 Pliers512 nearest1024 clears all object snaps2048 apparent intersection4096 extension8192 parallel parallel parallel parallel
from http://docs.autodesk.com/acd/2010/enu/autocad%202010%20user%20documentation/index.html?url=ws1a9193826455f5ffa23ce210c4a30acaf-4f1d.htm,topicnumber=d0e352473Good evening!
 

Forum statistics

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

Members online

No members online now.
Back
Top