You are welcome and I'm glad you like it. I'd been thinking about doing that
for some time, and your initial post made me think about it again. So thanks
to you for prodding me on! ;-)
Jeff
"Jason Stevens" wrote in message
news:403e5408$1_2@newsprd01...
> Jeff,
> That is awesome. Thank you very much. I am going to have it offset 5
times
> so I just have to do that part but this is great.
>
> Thanks,
> Jason
>
> "Jeff Mishler" wrote in message
> news:403e495e_2@newsprd01...
> > Jason,
> > Instead of using Sendcommand, which processes asynchrously with the
> > remaining code, why noy create your own curb function? I've created this
> as
> > a start for you, no error checking and it may/probably will fail if the
> > offset function truncates the pline but it should give you the
basics....
> >
> > Option Explicit
> >
> > Sub TestMe()
> > Dim ent As Object
> > Dim Pline As Acad3DPolyline
> > Dim newPline As Acad3DPolyline
> > Dim pt As Variant
> > Dim curbHeight As Double
> > Dim curbOffset As Double
> >
> > On Error Resume Next
> > ThisDrawing.Utility.GetEntity ent, pt, "Pick something:" '3dpoly gets
> > selected here
> > If (Err.Number = 0) Then
> > If TypeOf ent Is Acad3DPolyline Then
> > Set Pline = ent
> > curbHeight = ThisDrawing.Utility.GetReal(vbCrLf & "Curb height:
")
> > curbOffset = ThisDrawing.Utility.GetReal(vbCrLf & "Offset
> distance:
> > ")
> > Set newPline = MakeCurb(Pline, curbHeight, curbOffset)
> > End If
> > Else
> > 'The user didn't pick something
> > End If
> >
> > End Sub
> >
> > Public Function MakeCurb(Pline As Acad3DPolyline, height As Double,
offset
> > As Double) As Acad3DPolyline
> > Dim tempPline1 As AcadPolyline
> > Dim tempPline2 As AcadPolyline
> > Dim newPline As Acad3DPolyline
> > Dim temp As Variant
> > Dim coords As Variant
> > Dim newcoords As Variant
> > Dim i As Long
> >
> > coords = Pline.Coordinates
> > If offset <> 0 Then
> > Set tempPline1 = ThisDrawing.ModelSpace.AddPolyline(coords)
> > temp = tempPline1.offset(offset)
> > Set tempPline2 = temp(0)
> > newcoords = tempPline2.Coordinates
> > tempPline1.Delete
> > tempPline2.Delete
> > Else
> > newcoords = coords
> > End If
> > For i = 2 To UBound(newcoords) Step 3
> > newcoords(i) = coords(i) + height
> > Next i
> > Set newPline = ThisDrawing.ModelSpace.Add3DPoly(newcoords)
> > newPline.Layer = Pline.Layer
> > Set MakeCurb = newPline
> >
> > End Function
> >
> > HTH,
> > Jeff
> >
> >
> > "Jason Stevens" wrote in message
> > news:403e2ea0_2@newsprd01...
> > > I am using the following code to try and run a command and have it use
a
> > > 3dpolyline that gets selected by the user. The problem is at the
handent
> > > part of the code. How would I have the sendcommand use that 3dpoly?
I
> > have
> > > to use the sendcommand because the 3D Polyline Create Curb command can
> not
> > > be accessed any other way (as far as I know).
> > >
> > > Dim ent As Object
> > > Dim pt As Variant
> > > Dim Cmd1 As String
> > > Dim Cmd2 As String
> > > Dim Cmd3 As String
> > >
> > > Cmd1 = "(er_mnl)"
> > > Cmd2 = "(zz_sdsk'(er_grdcurb))"
> > > Cmd3 = "ldd"
> > >
> > > On Error Resume Next
> > > ThisDrawing.Utility.GetEntity ent, pt, "Pick something:" '3dpoly gets
> > > selected here
> > > If (Err.Number = 0) Then
> > > ThisDrawing.SendCommand Cmd1 & vbCr & Cmd2 & vbCr & Cmd3 & vbCr &
> > > "(handent """ & ent.Handle & """)"
> > > Else
> > > 'The user didn't pick something
> > > End If
> > >
> > >
> > > Thanks for any help,
> > > Jason
> > >
> > >
> >
> >
>
>