Jump to content

Vba/ selectionset filter problem..


classof

Recommended Posts

hello..

 

I want to know the number of line drawn at "curren layout" using "dxf code 410" on "selectionset filter".

But it didn't work properly. I don't know why.

Please help me about below code.

 

 

Sub LineSelect()

 

Dim mode As Integer

Dim gpCode(3) As Integer

Dim dataValue(3) As Variant

Dim ssetObj As AcadSelectionSet

 

With ThisDrawing

 

gpCode(0) = -4: dataValue(0) = "

 

gpCode(1) = 410: dataValue(1) = ThisDrawing.ActiveLayout.Name

 

gpCode(2) = 0: dataValue(2) = "LINE"

 

gpCode(3) = -4: dataValue(3) = "and>"

 

mode = acSelectionSetAll

 

On Error Resume Next

 

If .SelectionSets("SELECT") Then .SelectionSets("SELECT").Delete

 

On Error GoTo 0

 

Set ssetObj = .SelectionSets.Add("SELECT")

 

ssetObj.Select mode, , , gpCode, dataValue

 

 

MsgBox ssetObj.Count

 

End With

 

End Sub

 

 

thank you

Link to comment
Share on other sites

I know they say single line 'if/then' cond. statements need no 'end if', sometimes I have had strange things happen, and return the line after 'then', and end with 'end if', it adds a couple lines, but when in an erring sub, I always do that just to be certain it's not hanging. Also dump the error handling to see where the error is thrown. I guess not supposedly necessary, you may also try double checking the array dimension syntax to explicit dimensioning in variable dims

Link to comment
Share on other sites

I know they say single line 'if/then' cond. statements need no 'end if', sometimes I have had strange things happen, and return the line after 'then', and end with 'end if', it adds a couple lines, but when in an erring sub, I always do that just to be certain it's not hanging. Also dump the error handling to see where the error is thrown. I guess not supposedly necessary, you may also try double checking the array dimension syntax to explicit dimensioning in variable dims

 

thank you

i will try again..:wink:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...