.NET

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

AddAllowedClass in GetEntity

314 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 (314 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: 385
Registered: ‎06-27-2005
Message 3 of 3 (314 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()
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.