Jump to content

The Hamma

Member
  • Content Count

    162
  • Joined

  • Last visited

Posts posted by The Hamma


  1. Using part of twk's script I have tried to create a script that will sort sheet layers and their objects classes. 

     

    The goal is to have all objects in the sheet layer in the following classes

           Borders, Veiwports, Groups and other objects on sheet layer = 'SheetClass'

           Viewport Annotations including components of groups with in the annotations = 'Annotations'

           Drawing Label  = 'Drawing Labels'

     

    Everything works accept the components of groups within the annotations of a Viewport.

     

    Any suggestions?

     

    Python Script

    #collect handles of selected VPs on active layer
    def GetHandle(h):
    	vs.SetClass(h,'SheetClass')
    	if vs.GetTypeN(h) == 122:
    		if vs.GetParent(h) == vs.ActLayer():
    			hVP.append(h)
    		
    hVP = []
    vs.ForEachObjectInLayer( GetHandle,0,2,0 )
    
    #Traverse into the annotations group of selected VPs set classes
    for VP in hVP:
    	anno = vs.GetVPGroup(VP, 2)
    	h = vs.FInGroup(anno)
    	objs = [h]
    	h = vs.NextObj(h)
    	while h != vs.Handle(0):
    		objs.append(h)
    		h = vs.NextObj(h)
    	for obj in objs:
    		if vs.GetObjectVariableString(obj,1166) == 'Drawing Label':
    			vs.SetClass(obj,'Drawing Labels')
    		else:
    			def SetClassGroup_Contents(handle_to_group, className:str, descend=False):
    
    				class CustomObject():
    					def __init__(self, handle):
    						self.handle = handle
    
    						self.__old_class = vs.GetClass(self.handle)
    
    					@property
    					def old_class(self):
    						return self.__old_class
    
    					@old_class.setter
    					def old_class(self, value):
    						self.__old_class = value
    
    					@property
    					def obj_class(self):
    						return vs.GetClass(self.handle)
    
    					@obj_class.setter
    					def obj_class(self, value):
    						vs.SetClass(self.handle, value)
    
    					def restore_old_class(self):
    						self.obj_class = self.old_class
    			if vs.GetTypeN(handle_to_group) == 11: # Only work on groups TypeGroup == 11
    
    				if not descend:  # if descend parameter set then cycle through each item in group, default is set to false
    					stored_objects = [] #type: list[CustomObject]
    
    					def set_class_objs_in_group(h):
    						stored_objects.append(CustomObject(h))
    
    					vs.ForEachObjectInList(set_class_objs_in_group,0,1,vs.FInGroup(obj)) # See Documentation for parameter descriptions
    
    					vs.SetClass(handle_to_group,'annotation') # Set Class of overall group
    
    					for object in stored_objects:
    						object.restore_old_class()
    			else:
    				vs.SetClass(obj,'annotation') 

     


  2. 11 hours ago, JeremyLondonRMLA said:

    I think the '3 lines' The Hamma is referring to are the 3 axes of the 3D locus itself (see image attached), rather than a display error.

     

    There are workarounds for sure, but it would be an excellent feature if the displayed point size could be adjusted. At present it appears to be fixed at 1 pixel per point regardless of the zoom. If a free program like CouldCompare can implement point size adjustment, then I'd assume it's well within the capability of Vectorworks programmers to introduce something similar. If we get enough support for it on this thread perhaps it will make the shortlist for VW 2021! 

    20200128_Vectorworks_3D Locus_3 Lines.jpg

    You are correct and well said!


  3. Often times I run a command and vectorworks takes an exorbitant amount of time to compute. This time I was trying to convert an exterior elevation to lines.   It has been running for about an hour now with no progress. 

    image.thumb.png.2745f44e68b18595b6ea78991d4bd8b6.png

     

    There needs to be a way to quit commands without loosing your work.  Or just fix vectorworks so it doesn't take so long.  I am sure if it used 100% of the CPU's it would be much quicker. 

     


  4. This modification corrects the issue but it seems to me that if the points are read from HCenter as inches then they should be passed to RegularPolygon as inches. 

     

    HCenter(h,Px,Py);
    RegularPolygon((Px*25.4),(Py*25.4),(9*25.4),6,1);


  5. I have attached a file with two scripts in progress.  It is a script that I was developing to replace circles with hexagons.  The first version doesn't work as expected. It creates the hexagons but they are 1/25.40157 sized and location from the origin.  I modified the script to multiply the X,Y coordinates by 24.40157 and the size.  This places the hexagons in their proper location and size.   It seems that the script is converting the units to mm from inches. If I set the drawing units to mm the first script works

    Script Error.vwx


  6. 1 hour ago, Matt Panzer said:

     

    @The Hamma ,

     

    It looks like most of the objects in the 3D Component are set to display along with the 2D components. This is causing the objects to be rendered in hidden line behind the displayed 2d component. Try editing the 3D component of the symbol, select all of the objects, click on the "Display with 2D Components" button in the Object Info platte and uncheck all of the options. Once you do that, it should render much faster.

    Thanks that was the issue. 

    • Like 1

 

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