Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

pline from a point

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
213 Views, 5 Replies

pline from a point

I am trying to draw a verticle polyline from the midpoint (ti) of a line based on the text height
(ht) * 1.33 then continue with a horizontal line based on the text height (ht) * 4.0 so it looks
something like an L turned on its side.

could someone give me a helping hand with this. Im a very novice at lisp but can usually stumble
through ok.




--
Dave C. Johnson
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

In simplest terms, here's one way:

{code}
(command
"_.pline"
ti
(polar ti (/ pi 2) (* ht 1.33))
(polar (getvar 'lastpoint) 0 (* ht 4.0))
""
)
{code}

That would put the horizontal segment to the right. You can build in a User selection about which
way it goes, adding a multiplier of +1 or -1 to the distance in the second (polar) function, or
switching between 0 and pi for the angle, depending on their selection. [Similarly, you could let
the User choose whether the vertical goes up or down.] And you can force the Polyline width in case
the current width might be different, and various other things.

--
Kent Cooper


"djohnson" wrote...
I am trying to draw a verticle polyline from the midpoint (ti) of a line based on the text height
(ht) * 1.33 then continue with a horizontal line based on the text height (ht) * 4.0 so it looks
something like an L turned on its side.

could someone give me a helping hand with this. Im a very novice at lisp but can usually stumble
through ok.
--
Dave C. Johnson
Message 3 of 6
Anonymous
in reply to: Anonymous

thanks Kent I think I was trying to make it a lot more difficult then it needed to be.
once I get this to work in one direction and all verticle scales I will attempt to make it go left,
right, up or down. maybe even dialogue run. not sure since ive never done that 🙂

thanks again for the help


--
Dave C. Johnson
Message 4 of 6
Anonymous
in reply to: Anonymous

what do I need to do to set that as a variable
(setq vert (polar ti (/ pi 2) (* ht 1.33)) gives me a malformed list

in need to establish the points as variables so I can then place some text

Kent Cooper wrote:
> In simplest terms, here's one way:
>
> {code}
> (command
> "_.pline"
> ti
> (polar ti (/ pi 2) (* ht 1.33))
> (polar (getvar 'lastpoint) 0 (* ht 4.0))
> ""
> )
> {code}
>

--
Dave C. Johnson
Message 5 of 6
Anonymous
in reply to: Anonymous

That line's missing a right parenthesis at the end, but that's probably not what's giving you a
malformed list error. Otherwise it looks like it ought to work. Are you sure there are values
assigned to ti and ht?
--
Kent Cooper


"djohnson" wrote...
what do I need to do to set that as a variable
(setq vert (polar ti (/ pi 2) (* ht 1.33)) gives me a malformed list

in need to establish the points as variables so I can then place some text
....
Message 6 of 6
Anonymous
in reply to: Anonymous

OK so I cant count. that was the problem

yes there are values assigned to ti and ht
ht = text height
ti = midpoint of a line

after looking this some more I may have to rethink some stuff to take in account the vertical
exaggeration so my line is drawn correctly not only at 1:1 but 1:5 1:10 etc.

boy what a headache 🙂


--
Dave C. Johnson

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost