erasing a selection set

erasing a selection set

a.kouchakzadeh
Advocate Advocate
435 Views
2 Replies
Message 1 of 3

erasing a selection set

a.kouchakzadeh
Advocate
Advocate

Hello every one

and Mr. Yuan 

 

Im completely new to .NET and I'm using C# for my coding. I got 2 questions:

1. how to erase Items in a selection set   & how to delete the selection set itself.

2. in the picture, I have created a string and named in blklayers. but because its in an If statement, the program errors in line 213 and says blklayers does not exist in the current context.

I had to change the code in line 192 and wrote if (psr.status != PromptStatus.OK) { ...}

any suggestions?

code.JPG

 

 

@norman.yuan 

0 Likes
Accepted solutions (1)
436 Views
2 Replies
Replies (2)
Message 2 of 3

hosneyalaa
Advisor
Advisor

Hi

Change the number 1 by 8

0 Likes
Message 3 of 3

_gile
Consultant
Consultant
Accepted solution

Hi,

The scope of 'blknames' and 'blklayers' variables is the 'Then' statement of if (psr.Status == PromptStatus.OK). In C#, the scope of a variable is limited inside the curly braces where the variable is declared.

If you want to use them outside of this scope, you have to declare them outside of theis scope (i.e. before the if statement).



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes