.NET

Reply
Mentor
MarkPendergraft
Posts: 375
Registered: ‎06-27-2005
Message 1 of 3 (290 Views)

AddAllowedClass in GetEntity

290 Views, 2 Replies
10-12-2006 12:26 PM
I'm writing a program to list specific survey related data of Lines, Arcs, and Polylines.

i use the GetEntity function of the Editor.
I want to filter the types of objects that the user is allowed to pick.
I have seen code in C# using the AddAllowedClass of the PromptEntityOptions object. However i cannot seem to get it to work.

Here is my code thus far.....

Public Sub ListSurveyData()

Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Dim db As Database = HostApplicationServices.WorkingDatabase

Dim prEntOpt As PromptEntityOptions = New PromptEntityOptions("Select an Arc or Line: ")

'''''''''''''''''''''''''''''''''''''''''''''''''''
''''Cant figure this part out. !!!!
prEntOpt.AddAllowedClass(Type.GetType(Line), True)
prEntOpt.AddAllowedClass(Type.GetType(Polyline), True)
prEntOpt.AddAllowedClass(Type.GetType(Arc), True)
'''''''''''''''''''''''''''''''''''''''''''''''''''

prEntOpt.AllowNone = False

Dim prEntRes As PromptEntityResult = ed.GetEntity(prEntOpt)
If prEntRes.Status PromptStatus.OK Then Exit Sub


End Sub
Distinguished Contributor
jbooth
Posts: 223
Registered: ‎02-17-2006
Message 2 of 3 (290 Views)

Re: AddAllowedClass in GetEntity

10-12-2006 03:01 PM in reply to: MarkPendergraft
Type.GetType() requires a string. Use the GetType operator instead of calling the GetType method of the System.Type class.

ie: use GetType(Line) instead of Type.GetType(Line)

If it still doesn't work, feel free to post again. :smileywink:
Mentor
MarkPendergraft
Posts: 375
Registered: ‎06-27-2005
Message 3 of 3 (290 Views)

Re: AddAllowedClass in GetEntity

10-12-2006 03:15 PM in reply to: MarkPendergraft
i found a website half in japanese, with the code in english, and figured it out...... i needed to use GetType instead of type.gettype()
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.