I just cant get it

Mack Attack

Usenet Archive
Joined
Sep 11, 2003
Messages
34
Reaction score
0
I am trying to come up with a simple tail added to my section marker with a defined wider foot and length. I can't get it to stay at an orthoganal angle and the last length of the tail to work. Please help and thanks in advance

(defun C:tail ( / ort cla sna pt1 pt2 pt3 dst dsc wd1 lng )

(SETQ ORT (GETVAR "orthomode")) ;capture ortho mode
(SETVAR "orthomode" 1) ;turn on ortho
(SETQ CLA (GETVAR "clayer")) ;capture current layer
(SETQ SNA (GETVAR "osmode")) ;capture osmode
(SETVAR "osmode" 16) ;change osmode to quadrant only (SETVAR "plinewid" 0) ;set pline width to zero (command "layer" "m" "A-anno-symb" "c" "7" "" "") ;make or change to proper layer

(SETQ pt1 (GETPOINT "\nPick first point:")) ;set first selection (SETQ pt2 (GETPOINT "\nSelect end point:")) ;set length of tail (SETQ dsc (GETVAR "dimscale")) ;capture dimscale value (SETQ wd1 (* 0.0625 dsc)) ;set width of pline (SETQ lng (* 0.1875 dsc)) ;set lenght of tail (progn (command "pline" pt1 pt2 "w" wd1 "" lng) ) (SETVAR "orthomode" ORT) (SETVAR "clayer" CLA) (SETVAR "osmode" SNA)
)
 
I am trying to come up with a simple tail added to my section marker with a

defined wider foot and length. I can't get it to stay at an orthoganal angle and the last length of the tail to work. Please help and thanks in advance

without testing and the feeling, that I don't know how you really want the result to look like...

change
(command "pline" pt1 pt2 "w" wd1 "" lng)

to

(command "_pline" pt1 pt2 "_w" wd1 "" "_l" lng "")

should produce something like

if you want to specify the length, don't forget the "_LENGTH" option...

should the second segment go just east:

(setq pt3 (mapcar '+ pt2 (list lng 0.0 0.0)))

(command "_pline" pt1 pt2 "_w" wd1 "" pt3 "")

hth
 
Thanks for got about the _length. do you have any suggestions on how to keep it otho (90deg)
still don't know exactly. again 2 possibilities for you to choose from:

a) from pt1 to pt2 then 90 degrees CCW?

(setq p3 (polar pt2 (+ (angle pt1 pt2) (* pi 0.5)) lng)) (command "_pline" pt1 pt2 "_w" wd1 "" pt3 "")

b) from pt1 to pt2 then horizontally to the east?
if nothing of this suits your needs, please provide an image or clear description.
;^)
 
OK after looking at my question I realize it was worded very bad. I can not seem to get the whole pline at a specified angle (i.e. 0, or 90). I can get the tail of the pline strait or perp to the main pline but the pline itself comes up at a weird angle. Again all help is greatly appreciated.
 
i haven't seen the rest of your code but
(command "_pline" pt1 pt2 "_w" wd1 "" pt3 "")
should be
(command "_pline" "_non" pt1"_non" pt2 "_w" wd1 "" "_non" pt3 "") to avoid osnap problems ?
 
Here is my code as of today

(defun C:ta ( / ort cla sna pt1 pt2 pt3 dst dsc wd1 lng zer )

(SETQ ORT (GETVAR "orthomode")) ;capture ortho mode
(SETVAR "orthomode" 1) ;turn on ortho
(SETQ CLA (GETVAR "clayer")) ;capture current layer
(SETQ SNA (GETVAR "osmode")) ;capture osmode
(SETVAR "osmode" 16) ;change osmode to quadrant only (SETVAR "plinewid" 0) ;set pline width to zero (command "layer" "m" "A-anno-symb" "c" "7" "" "") ;make or change to proper layer

(SETQ pt1 (GETPOINT "\nPick first point:")) ;set first selection (SETQ pt2 (GETPOINT "\nSelect end point:")) ;set length of tail (SETQ dsc (GETVAR "dimscale")) ;capture dimscale value (SETQ wd1 (* 0.0625 dsc)) ;set width of pline (SETQ lng (* 0.1875 dsc)) ;set lenght of tail (SETQ pt3 (polar pt2 (+ (angle pt1 pt2) (* pi 0.5)) lng)) (command "_pline" pt1 pt2 "_w" wd1 "" "_l" lng "")

(SETVAR "orthomode" ORT) ;returns the ortho to original state (SETVAR "clayer" CLA) ;returns the current layer to original state (SETVAR "osmode" SNA) ;returns the osnap to original state )

I can not seem to get the whole pline at a specified angle (i.e. 0, or 90). I can get the tail of the pline strait or perp to the main pline but the pline itself comes up at a weird angle. Again all help is greatly appreciated.
 
I did like that suggestion and I have added since that post but I am still having the problem mentioned before
 
On 15.09.2003 17:04 Mack Attack wrote:

I did like that suggestion and I have added since that post but I am still having the problem mentioned before

hmm. could you please describe what
1) you want to click/enter/show on screen
2) each input of yours shall affect

from the comment of your code i guess you want to specify a point for  the pline placement.

you ask for a 2nd point. comment says "distance".
you took (getdist) and calculation of following points into consideration?

you have ortho on, osmode set to QUAD, but changed the code that the routine doesn't use the osnap. .. if you enter 10,10 and 10,0 you should get a vertical pline 10,10 and 20,10 you should get a horizontal one.

so i don't see a problem with this routine.
waiting for you to show us ;-)

"Mark Propst" <nonentityatplanetkcdotcom> wrote:

you didn't like "_non" ? "Mack Attack" <> wrote:

Here is my code as of today

-- ruul wblocks don't exist
 
I know I have sucked at trying to explain the problem but I think you understand what I am trying accomplish.  The fact that the ortho is on does not affect the finished line angle.  The fact that it uses the second pick point (as the final placement of the main line) there is nothing making this point 90 deg to the first pick point so whatever the angle is to the first pick point is the angle that the pline follows.

 

I believe I need to take the distance from point1 and point2 and use it with the polar command but I can't seem to get work.  I know I'm missing something simple and trying to make it too complicated

 

"ruul morawetz" <> wrote:

On 15.09.2003 17:04 Mack Attack wrote:

 
hmm. could you please describe what
1) you want to click/enter/show on screen
2) each input of yours shall affect

from the comment of your code i guess you want to specify a point for  the pline placement.

you ask for a 2nd point. comment says "distance".
you took (getdist) and calculation of following points into consideration?

you have ortho on, osmode set to QUAD, but changed the code that the routine doesn't use the osnap. . if you enter 10,10 and 10,0 you should get a vertical pline 10,10 and 20,10 you should get a horizontal one.

so i don't see a problem with this routine.
waiting for you to show us ;-)
 
aaaah, .....
i didn't see you didn't specify the first point.
sorry, some things i just assume and overlook

try using p1 when asking for p2
(setq p1 " First point: ")
(setq p2 (getpoint " 2nd point: " p1))

I know I have sucked at trying to explain the problem but I think you understand what I am trying accomplish. The fact that the ortho is on does not affect the finished line angle. The fact that it uses the second pick point (as the final placement of the main line) there is nothing making this point 90 deg to the first pick point so whatever the angle is to the first pick point is the angle that the pline follows.

I believe I need to take the distance from point1 and point2 and use it with the polar command but I can't seem to get work. I know I'm missing something simple and trying to make it too complicated

i also missed it ;-)
 

Latest threads

Back
Top