Jump to content

Recommended Posts

Posted

I encounter an error when selecting a polyline (the same code works fine for 3dpolyline, line and arc)

 

    Dim Pick As Variant
   Dim Polyline As AcadPolyline
   ThisDrawing.Utility.GetEntity Polyline, Pick, vbCr & "Select the polyline"

 

I tried to find the problem but the only thing I found is that when selecting a polyline, the entity is not of type AcadPolyline. Why??

And how can I select a polyline?

 

    Dim Pick As Variant
Dim Polyline As AcadPolyline
   ThisDrawing.Utility.GetEntity Ent, Pick, vbCr & "Select the polyline"
If TypeOf Ent Is AcadPolyline Then
Set Polyline = Ent
End If

Posted

Autodesk has made it a bit confusing with the various polyline entities and how they are referred to in the application versus API context. The bottom line for your situation is:

 

Dim LWPolyline As AcadLWPolyline

. . . .

If TypeOf Ent Is AcadLWPolyline Then

Set LWPolyline = Ent

Posted

Thanks for the solution. The program works as it should.

 

Thank you very much

 

Huibert

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...