twk Posted November 13, 2016 Share Posted November 13, 2016 (edited) So I was trying to get wall areas through the vectorscript/python module, but I can't seem to crack it. The available calls we're given are: WallArea_Gross (criteria based) WallArea_Net (criteria based) GetComponentNetArea I have a list of walls, and I'm wanting to iterate through each wall in this list and retrieve it's wall area. I'm not using the worksheets because I'm writing these values directly to a csv file. And I've had to write separate functions to loop through(look into) Design Layer Viewports (which VW can't filter for in worksheets) to get handles to walls in layers visible in those layers. So simply, how would I run those criteria based functions above, through a list of handles to a wall. eg. crit = "(T=WALL) & (HANDLE=h)" <-- ??????? areas = [] for x in list_walls: a = vs.WallArea_Gross(crit) areas.append(a) Thanks in advance! Edited November 13, 2016 by twk Quote Link to comment
twk Posted November 13, 2016 Author Share Posted November 13, 2016 Well I'll be, it's all in the Appendix! Quote Link to comment
MullinRJ Posted November 14, 2016 Share Posted November 14, 2016 Tui, Give each wall a name, Call your Area function (criteria by name), Delete the name, Repeat crit = "N='George'" for x in list_walls: vs.SetName(x, 'George') # assuming x is a handle from list_walls a = vs.WallArea_Gross(crit) vs.DelName('George') areas.append(a) Raymond 1 Quote Link to comment
twk Posted November 14, 2016 Author Share Posted November 14, 2016 (edited) Thanks @MullinRJ.. Unfortunately, I can't go down this route as I'm iterating through handles to walls that are on different layers throughout the file (in this case, a Project Sharing File), and I don't have exclusive access to each layer (5 floor plans across three towers = 15 floor plans). It's not really feasible to have checked out each layer every time I need to call this function for wall take offs (name wall, get info, delete name). However the getPrefs from the Dev Wiki suite my needs perfectly: list_areas_gross = [] list_areas_net = [] for x in list_walls: gross = vs.GetObjectVariableReal(x,608) #left side of wall net = vs.GetObjectVariableReal(x,611) # left side of wall list_areas_gross.append(gross) list_areas_net.append(net) total = sum(list_areas_gross) #etc, etc Edited November 14, 2016 by twk Quote Link to comment
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.