Making Polylines

Making Polylines

Anonymous
Not applicable
308 Views
5 Replies
Message 1 of 6

Making Polylines

Anonymous
Not applicable
Has anyone tried to use .sendcommand "_Pedit" to create a polyline of a group of lines on a SelectionSet? Would it work, similar to the AutoLISP command "_Pedit" X "_Y" "_J" SS "" "")? I tried doing this by creating the vertices list as required by the addpolyline method, but that is a pain. Any suggestiong, workarounds, or ideas would be greately appreciated.
0 Likes
309 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
You can use the command method, but the SendCommand
method only accepts string arguments. Therefore the workaround is to send
strings that execute lisp. Have lisp get the entities. Here is a function I
wrote to have lisp return an object to SendCommand given an object obtained by
vba.

 

Public Function Ent2lspEnt(entObj As AcadEntity) As
String
    'Designed to work with SendCommand, which can't
pass objects.
    'This gets an objects handle and converts it
to a string
    'of lisp commands that returns an entity name
when run in SendCommand.
    Dim entHandle As
String
    entHandle = entObj.Handle
   
Ent2lspEnt = "(handent " & Chr(34) & entHandle & Chr(34) &
")"
End Function


--
--
Ed
--


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Has
anyone tried to use .sendcommand "_Pedit" to create a polyline of a group of
lines on a SelectionSet? Would it work, similar to the AutoLISP command
"_Pedit" X "_Y" "_J" SS "" "")? I tried doing this by creating the vertices
list as required by the addpolyline method, but that is a pain. Any
suggestiong, workarounds, or ideas would be greately
appreciated.
0 Likes
Message 3 of 6

Anonymous
Not applicable
Seems like you could just use the start and
endpoints of the existing lines to draw new polylines through the code... and
avoid sendcommand altogether.



Kevin


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Has
anyone tried to use .sendcommand "_Pedit" to create a polyline of a group of
lines on a SelectionSet? Would it work, similar to the AutoLISP command
"_Pedit" X "_Y" "_J" SS "" "")? I tried doing this by creating the vertices
list as required by the addpolyline method, but that is a pain. Any
suggestiong, workarounds, or ideas would be greately
appreciated.
0 Likes
Message 4 of 6

Anonymous
Not applicable
Here's an example of converting lines to individual polylines -- you could
add the logic for the JOIN prompt. Depending on how general purpose you
want your routine to be, you'll want to account for selection sets with only
one line, etc. The prompts from the PEDIT command will be different for
this case, and others.

http://groups.google.com/groups?threadm=2751F8D4CD903B129132D733CFC8D8E6@in.WebX.maYIadrTaRb

Good luck,

James
0 Likes
Message 5 of 6

Anonymous
Not applicable
Thanks, but how can I get to that thread? I am using the web browser.
0 Likes
Message 6 of 6

Anonymous
Not applicable
You may have to copy/paste the link back together if it got broken up in the
post, and then copy/paste it into the address bar of your browser. If your
web browser can get to http://groups.Google.com, you should be able to get
to the previous link.


"HJohn" wrote in message
news:f1a3c3a.3@WebX.maYIadrTaRb...
> Thanks, but how can I get to that thread? I am using the web browser.
0 Likes