I don't have time to do a thorough search for you, but this should get you
started. http://tinyurl.com/ynmh. Take note of the array for the vertices.
It only uses two points. You just have to add more vertices. Use google.com
to seach this ng or use the search feature in the web version. I found this
with just "polyline" as the keyword.
--
--
Ed
--
"Nathan Guill" wrote in message
news:2C0E7310104B18878321281F927837EF@in.WebX.maYIadrTaRb...
> Okay, how do I do that? I know how I can add the entities that share a
> starting or ending point with the original entity, but how do I mimic the
> "join all" function of PEDIT in ActiveX without creating an infinate loop?
> I searched for something already written that might help, but I still
don't
> understand how to do that.
>
> Am I making sense? Sorry if I'm not.
>
> "Ed Jobe" wrote in message
> news:6A3B51A14F1A8A939FD1071E9613423A@in.WebX.maYIadrTaRb...
> > That's true. I forgot they added that, it didn't used to do that. I
havn't
> > used it in a while. But in the context of this discussion, you still had
> go
> > through the extra step of telling it to add more ents. The command just
> > filtered out all the lines that connect to it. You need to duplicate
that
> > using ActiveX if you aren't going to use SendCommand.
> >
> > --
> > --
> > Ed
> > --
> > "Nathan Guill" wrote in message
> > news:BF22288999FE458D9E3773E64A58E215@in.WebX.maYIadrTaRb...
> > > I'm sorry to tell you, but if you type PEDIT, select a line, tell it
to
> > turn
> > > it into a pline, then select join and then type in all, any lines
> > connected
> > > to that first line you selected will then be joined to that line. I
> know
> > > this works as I do this many times a day. I NEVER have to select more
> > than
> > > one line as I tell it to join ALL. Since ONLY the entities that share
> > some
> > > common point can be joined, autocad only joins those entities. Don't
> > > beleive me... TRY IT.
> > >
> > >
> > > "Ed Jobe" wrote in message
> > > news:2690302D83BEE74598E4956B343E9FEA@in.WebX.maYIadrTaRb...
> > > > The PEDIT command joins connected lines, but it doesn't magically
find
> > > them
> > > > for you, you have to select them. If you are going to offer this
> feature
> > > in
> > > > your code, at the point you determine that the single ent they
> selected
> > is
> > > > not a pline (assuming its a line or arc), then you need to prompt
the
> > user
> > > > to select the rest of the ents to perform the join on. Use their
> > geometry
> > > > info to construct a pline via ActiveX. If you want just get your
> command
> > > > working for now, only allow them to select plines and quit if they
> want
> > to
> > > > perform the join themselves. You can add the join functionality
after
> > you
> > > > get the bulk of the command working. Check this ng for code on how
to
> > make
> > > a
> > > > pline.
> > > >
> > > > --
> > > > --
> > > > Ed
> > > > --
> > > > "Nathan Guill" wrote in message
> > > > news:65471D62C2CFC09F5007D338D1F4FAB7@in.WebX.maYIadrTaRb...
> > > > > You're right. I only have one entity when I first test for a
pline,
> > > hence
> > > > > the "join all" operation in the sendcommand. Basically, the
entity
> > the
> > > > user
> > > > > will be selecting will be part of a cross-section of a ring. If
> it's
> > a
> > > > > closed polyline then it revolves this section and gets a weight,
> > > > otherwise,
> > > > > it attemps to join all connected lines into a closed polyline then
> > gets
> > > > the
> > > > > weight. That's why I think I have to use the sendcommand. Do you
> > know
> > > of
> > > > > another way to join all connected lines together with only one
> entity
> > > > > selected?
> > > > >
> > > > >
> > > > > "Ed Jobe" wrote in message
> > > > > news:D1FACECEECA8980641C179038F681598@in.WebX.maYIadrTaRb...
> > > > > > Something else just occured to me. At the point you check for a
> > pline,
> > > > you
> > > > > > only have one ent. You can't make a closed pline with one ent.
> > You'll
> > > > have
> > > > > > to rethink your program logic. Do you offer to make a pline at
> all,
> > or
> > > > > just
> > > > > > restrict input to plines? If yes to convert to plines, you'll
have
> > to
> > > > > > reselect to allow multiple ents.
> > > > > >
> > > > > > --
> > > > > > --
> > > > > > Ed
> > > > > > --
> > > > > > "Ed Jobe" wrote in message
> > > > > > news:4386729F4AA191283425321602C138FA@in.WebX.maYIadrTaRb...
> > > > > > > I'm leaving pretty quick, so I don't have time to give more
> > detail,
> > > > but
> > > > > > > SendCommand is asyncronous. It is completing after you look
for
> > the
> > > > last
> > > > > > > ent. Also, you Dim'ed ss, but didn't create an ss. You might
> also
> > > > search
> > > > > > > this ng on how to make a poly line. That's been discussed
> before.
> > > Get
> > > > > that
> > > > > > > info and go with Mark's suggestion to create the poly via
> ActiveX.
> > > > Then
> > > > > > you
> > > > > > > can forget the ss route and SendCommand.
> > > > > > >
> > > > > > > --
> > > > > > > --
> > > > > > > Ed
> > > > > > > --
> > > > > > > "Nathan Guill" wrote in message
> > > > > > > news:588D9043A9B0E48EB7EB8D4175E4E7CB@in.WebX.maYIadrTaRb...
> > > > > > > > Basically, I just "joined all" the connected entities to the
> one
> > > the
> > > > > > user
> > > > > > > > selected to create the pline.
> > > > > > > >
> > > > > > > > select doesn't return anything, though.
> > > > > > > >
> > > > > > > > Below is the code I have so far. To set it up, just create
a
> > > > > rectangle
> > > > > > > (not
> > > > > > > > crossing the X plane) and explode it.
> > > > > > > >
> > > > > > > > Function GetWeight()
> > > > > > > > Dim basePnt As Variant
> > > > > > > > Dim centerObj As AcadObject
> > > > > > > > Dim strCenter As String
> > > > > > > > Dim strWeight As String
> > > > > > > > Dim Response As VbMsgBoxResult
> > > > > > > > Dim returnObj As AcadObject
> > > > > > > > Dim ss As AcadSelectionSet
> > > > > > > >
> > > > > > > > ThisDrawing.Utility.InitializeUserInput 1, "Yes No"
> > > > > > > >
> > > > > > > > ' Prompt the user to input any of the keywords.
> > > > > > > > strWeight = ThisDrawing.Utility.GetKeyword("Are you
looking
> > for
> > > > the
> > > > > > > weight
> > > > > > > > (Yes No):")
> > > > > > > >
> > > > > > > > ThisDrawing.Utility.InitializeUserInput 8
> > > > > > > > Start:
> > > > > > > > ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select
> > > > > > cross-section
> > > > > > > > for calculation: "
> > > > > > > >
> > > > > > > > If Not TypeOf returnObj Is AcadLWPolyline Then
> > > > > > > > If Len(returnObj.Handle) = 0 Then
> > > > > > > > VBA.MsgBox "You must select an entity to continue.",
> > > > > vbExclamation
> > > > > > +
> > > > > > > > vbOKOnly, _
> > > > > > > > "No Entity"
> > > > > > > > GoTo Start
> > > > > > > > End If
> > > > > > > > Response = VBA.MsgBox("This entity is not a polyline," &
> > > > > VBA.vbCrLf
> > > > > > &
> > > > > > > _
> > > > > > > > "Should I try and make it one?", vbQuestion + vbYesNo,
> > > "Wrong
> > > > > > Entity
> > > > > > > > Type")
> > > > > > > >
> > > > > > > > If Response = vbNo Then End
> > > > > > > >
> > > > > > > > ThisDrawing.SendCommand "pedit" & VBA.vbCr &
> > > > Ent2lspEnt(returnObj)
> > > > > &
> > > > > > _
> > > > > > > > VBA.vbCr & "Yes" & VBA.vbCr & "Join" & VBA.vbCr &
"All"
> &
> > > > > VBA.vbCr
> > > > > > &
> > > > > > > > VBA.vbCr & _
> > > > > > > > VBA.vbCr
> > > > > > > >
> > > > > > > > ss.Select acSelectionSetLast
> > > > > > > > 'returnObj = ThisDrawing.SendCommand("(entlast)")
> > > > > > > >
> > > > > > > > If Not TypeOf returnObj Is AcadLWPolyline Then
> > > > > > > > VBA.MsgBox "This entity cannot be made into a
> Polyline.",
> > > > > > > > vbExclamation + vbOKOnly, _
> > > > > > > > "Wrong Entity Type"
> > > > > > > > End
> > > > > > > > End If
> > > > > > > > End If
> > > > > > > >
> > > > > > > > ThisDrawing.Utility.InitializeUserInput 1, "Xaxis Yaxis
> > Object"
> > > > > > > >
> > > > > > > > ' Prompt the user to input any of the keywords.
> > > > > > > > strCenter = ThisDrawing.Utility.GetKeyword("Select center
> line
> > > > > (Xaxis
> > > > > > > > Yaxis Object):")
> > > > > > > >
> > > > > > > > ThisDrawing.Utility.InitializeUserInput 8
> > > > > > > >
> > > > > > > > Select Case strCenter
> > > > > > > > Case "Xaxis"
> > > > > > > > ThisDrawing.SendCommand "undo mark revolve " & _
> > > > > > > > FMI_Utilities.FMI.Ent2lspEnt(returnObj) & " X 360 "
> > > > > > > > Case "Yaxis"
> > > > > > > > Case "Object"
> > > > > > > > ThisDrawing.Utility.GetEntity centerObj, basePnt,
> "Select
> > > > center
> > > > > > > line
> > > > > > > > object: "
> > > > > > > > Case Else
> > > > > > > > End
> > > > > > > > End Select
> > > > > > > >
> > > > > > > > ThisDrawing.Utility.GetEntity returnObj, basePnt
> > > > > > > >
> > > > > > > > If strWeight = "Yes" Then
> > > > > > > > VBA.MsgBox "This part weighs " & (returnObj.Volume *
> 0.297)
> > &
> > > "
> > > > in
> > > > > > > Inco
> > > > > > > > 718"
> > > > > > > > Else
> > > > > > > > VBA.MsgBox "The volume of this part is " &
> returnObj.Volume
> > > > > > > > End If
> > > > > > > > End Function
> > > > > > > >
> > > > > > > > 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 Jobe" wrote in message
> > > > > > > > news:1FE06E944FA26D430C181796A59B2F14@in.WebX.maYIadrTaRb...
> > > > > > > > > If you just created an entity, it will be the last in the
> db.
> > > Just
> > > > > > like
> > > > > > > > you
> > > > > > > > > can use the Last argument to any selection prompt in acad,
> the
> > > > > > selection
> > > > > > > > set
> > > > > > > > > object has this option too.
> > > > > > > > > Dim ss As AcadSelectionSet
> > > > > > > > > ss.Select acSelectionSetLast
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > --
> > > > > > > > > Ed
> > > > > > > > > --
> > > > > > > > > "Nathan Guill" wrote in message
> > > > > > > > >
news:D5E4A8C60E0074F0EC38BF7722C37DC0@in.WebX.maYIadrTaRb...
> > > > > > > > > > This is probably staring me in the face, but ...
> > > > > > > > > >
> > > > > > > > > > I have a routine that prompts the user for an entity,
and
> if
> > > > this
> > > > > > > entity
> > > > > > > > > is
> > > > > > > > > > not a closed polyline, then it attempts to make it one
for
> > the
> > > > > user.
> > > > > > > > All
> > > > > > > > > of
> > > > > > > > > > this works fine, my problem is in the retest. I can't
> seem
> > to
> > > > > > > reselect
> > > > > > > > > the
> > > > > > > > > > (now a polyline) entity within the code (i.e. without
user
> > > > > > > interaction).
> > > > > > > > I
> > > > > > > > > > obtain the original entity with
> > ThisDrawing.Utility.GetEntity
> > > > and
> > > > > > then
> > > > > > > > > > create the polyline with sendcommand.
> > > > > > > > > >
> > > > > > > > > > Any help would be appreciated.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>