Hello,
I'm using Autocad 2010 with VB6.0.
I want to use .Net function "PromptEntityResult" in vb6.0.
could you explain me how can I use that function in vb6.0 or
what is equivalent function for PromptEntityResult in vb6.0
Thanks in advance,
thenndral
See example, not mine just converted on VB.NET:
<CommandMethod("lx")> _ Public Shared Sub GetEntityExample() ''converted fro C# code writen by TT Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument Dim ed As Editor = doc.Editor Dim peo As New PromptEntityOptions(vbLf & "Select a line: ") peo.SetRejectMessage(vbLf & "Not a line...") peo.AddAllowedClass(GetType(Line), True) Dim per As PromptEntityResult = ed.GetEntity(peo) If per.Status <> PromptStatus.OK Then Return End If Dim ppo As New PromptPointOptions(vbLf & "Specify a point: ") ppo.AllowNone = True Dim tm As Autodesk.AutoCAD.ApplicationServices.TransactionManager = doc.TransactionManager tm.EnableGraphicsFlush(True) Using tr As Transaction = tm.StartTransaction() Dim ln As Line = DirectCast(per.ObjectId.GetObject(OpenMode.ForRead), Line) Dim btr As BlockTableRecord = DirectCast(doc.Database.CurrentSpaceId.GetObject(OpenMode.ForWrite), BlockTableRecord) Try While True Dim ppr As PromptPointResult = ed.GetPoint(ppo) If ppr.Status <> PromptStatus.OK Then Exit While End If If ppr.Value = Point3d.Origin Then Continue While End If Dim pt As Point3d = ppr.Value Dim nl As New Line(pt, ln.EndPoint) ln.ColorIndex = 121 btr.AppendEntity(nl) tm.AddNewlyCreatedDBObject(nl, True) tm.QueueForGraphicsFlush() tm.FlushGraphics() ed.UpdateScreen() End While Finally tr.Commit() End Try End Using End Sub
Hello Hallex,
Thanks for your reply.
I mean, I would like to know the equivalent function for PromptEntityResult in VB 6.0
I'm using Autocad 2010 with VB6.0.
Thanks in advance,
thenndral
Hi,
I don't know an exactly replacement for PromptEntityResult as this is not available in the COM-API of AutoCAD.
If you just search a version of entity-selection you might check the Utility.GetEntity method (you find some dotNET to VBA comparisions >>>here<<<).
- alfred -
Hi,
Thanks for your reply.
Let me search in entity-selection area.
Thanks again,
thenndral