classof Posted July 21, 2010 Share Posted July 21, 2010 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 Quote Link to comment Share on other sites More sharing options...
10west Posted July 26, 2010 Share Posted July 26, 2010 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 Quote Link to comment Share on other sites More sharing options...
classof Posted July 27, 2010 Author Share Posted July 27, 2010 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: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.