
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a portion of my routine below. Basically I need the user to continue to loop through the command. They are picking Circles or blocks in the drawing and I get the insertion point, then insert a new block. However, whenever they try and use a transparent zoom or pan to move around the drawing when the promptentityresult is hit, it zooms back to the original location. How do I stop it from doing that? Any help or direction is much appreciated. Here is a code....
<
CommandMethod("getpnt", CommandFlags.Session)> _
Sub findpnt()
Dim cnt AsInteger = 0
Dim NEWPNT AsPoint3d = GetInsPoint()
While cnt < 3
NEWPNT = GetInsPoint()
' other code is inserted here...
cnt = cnt + 1
EndWhile
EndSub
Public Function GetInsPoint()
Dim inspnt AsPoint3d
Dim acdoced AsDocument = Application.DocumentManager.MdiActiveDocument
Dim myed AsEditor = acdoced.Editor
Dim db AsDatabase = HostApplicationServices.WorkingDatabase
Using mytrans2 AsTransaction = db.TransactionManager.StartTransaction()
Dim myPEO AsNewPromptEntityOptions(vbLf & "Select Circle or Block: ")
myPEO.SetRejectMessage(
"You must select a Circle or Block.")
myPEO.AddAllowedClass(
GetType(Circle), True)
myPEO.AddAllowedClass(
GetType(BlockReference), True)
myPEO.AllowNone =
False
Dim symbolent AsPromptEntityResult = myed.GetEntity(myPEO)
If symbolent.Status = PromptStatus.OK Then
Dim Objid AsObjectId = symbolent.ObjectId
Dim ent AsEntity = CType(mytrans2.GetObject(Objid, OpenMode.ForRead), Entity)
Dim enttype1 AsString = ent.GetType().ToString
Dim enttype AsString = Objid.ObjectClass.DxfName
SelectCase enttype
Case"CIRCLE"
Dim circleobj AsCircle = mytrans2.GetObject(Objid, OpenMode.ForRead)
inspnt = circleobj.Center
Case"INSERT"
Dim blockent AsBlockReference = mytrans2.GetObject(Objid, OpenMode.ForRead)
inspnt = blockent.Position
EndSelect
EndIf
EndUsing
Return inspnt
EndFunction
Solved! Go to Solution.