Jump to content
twk

WALL AREAS VIA SCRIPT!!!???

Recommended Posts

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 by twk

Share this post


Link to post

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

 

  • Like 1

Share this post


Link to post

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 by twk

Share this post


Link to post

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
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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...