dkiellor Posted September 9, 2010 Share Posted September 9, 2010 Hey guys im new to this sort of thing and im having a little trouble. I am currently trying to put together a macro to export my titleblock info from all layout sheets to excel. i have found something very similar for the selection set but it only reads the modelspace. I cant seem to figure out why it only reads the modelspace either. is it part of the ThisDrawing.Utility variable? Is there anyway it could read all layouts in the drg? Any help would be great. Cheers Dave Here is the script i found earlier Sub GetNamedInserts() Dim entbref As AcadBlockReference Dim TempObjSS As AcadSelectionSet Dim intCode(2) As Integer Dim varData(2) As Variant Dim strName As String strName = ThisDrawing.Utility.GetString(0, "titleblock: ") SSInit Set TempObjSS = ThisDrawing.SelectionSets.Add("TempSSet") intCode(0) = 0: varData(0) = "Insert" intCode(1) = 67: varData(1) = 0 intCode(2) = 2: varData(2) = strName TempObjSS.Select acSelectionSetAll, , , intCode, varData MsgBox "There are " & TempObjSS.Count & " inserts referencing " & strName & " in Modelspace" End Sub Sub SSInit() Dim SSS As AcadSelectionSets Dim SS As AcadSelectionSet Set SSS = ThisDrawing.SelectionSets If SSS.Count > 0 Then For Each SS In SSS If SS.Name = "TempSSet" Then SS.Delete Exit For End If Next End If End Sub Quote Link to comment Share on other sites More sharing options...
SEANT Posted September 10, 2010 Share Posted September 10, 2010 This setting "intCode(1) = 67: varData(1) = 0" restricts the selection process to ModelSpace only. To restict for Paperspace only it would be: "intCode(1) = 67: varData(1) = 1" Depending on what will happen downstream, however, additional processing may be required to isolate a specific layout. Quote Link to comment Share on other sites More sharing options...
dkiellor Posted September 10, 2010 Author Share Posted September 10, 2010 Cheers seant i will have a play. Regards Dave 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.