VB.NET-INSTANTIATE A CLASS-INITIALIZE A VARIABLE

VB.NET-INSTANTIATE A CLASS-INITIALIZE A VARIABLE

cturlington
Collaborator Collaborator
572 Views
1 Reply
Message 1 of 2

VB.NET-INSTANTIATE A CLASS-INITIALIZE A VARIABLE

cturlington
Collaborator
Collaborator

Hello,

 

I am using Visual Basic 2013, the Community edition with the Autocad.NET PLUG-IN Wizard installed.

 

I have been working with Lab2 of the Lessons from the Autodesk tutorial series found here: http://adndevblog.typepad.com/autocad/devtv/

 

I have been pondering the following Visual Basic statement:

 

Dim getWhichEntityOptions As PromptKeywordOptions = New PromptKeywordOptions("Which entity do you want? [Circle/Block:")

 

My understanding is this: the Dim statement is creating a new instance of the class PromptKeywodOPtions() and passing into it the character string of "Which entity do you want? [Circle/Block:]".  The new class is also the data type of the variable  getWhichEntityOptions as it is initialized as a character string.  In summary the new instance of the class is Instantiated and the variable is initialized in the Dim statement, the PromptKeywordOptions() class does the work to prompt the user with specified text string and accept user input as "Circle" or "Block".

 

Can someone confirm if my above explanation is correct ?  

 

 

0 Likes
Accepted solutions (1)
573 Views
1 Reply
Reply (1)
Message 2 of 2

Jeff_M
Consultant
Consultant
Accepted solution
Yes, this instantiates the object, but you still need to add the KeyWords Circle and Block. The Lab example does this by adding the second argument of "Circle Block", this can also be done by adding to the Keywords property:
getWhichEntityOptions.Keywords.Add("Circle")
getWhichEntityOptions.Keywords.Add("Block")

(Note the exact format for VB may be different than what I show...don't use VB enough to verify)
Jeff_M, also a frequent Swamper
EESignature