Jump to content

The Hamma

Member
  • Posts

    449
  • Joined

  • Last visited

Posts posted by The Hamma

  1. 9 hours ago, Marissa Farrell said:

    Unfortunately, I don't think that's exposed to us in any meaningful way at this point. Part of the reasoning, I assume, is that you can have multiple WG libraries.

    I'll check to see if there are any workarounds (I've also been wanting WG library support)

     

    For now I created a symbolic link from the Workgroup directory to my User directory. 

     

    mklink /J "<Path to your User folder>\2025\Libraries\Defaults\Marionette" "<Path to your workgroup folder>\2025\Libraries\Defaults\Marionette"

     

    Only issue is that the Workgroup folder must be a synced folder rather than a network drive folder. 
     

  2. I have just created this script to create an overhead coiling door plugin style and symbol to override the geometry. 

     

    You have to add the two files attached to your favorites.  Once they are there you right click the "OHCD Generator" file to open. 

     

    After you open the file double click the script named "Overhead Coiling Door Generator"

    Input the dimensions required. (Note you need to know what the thickness of the wall you will be inserting the door into is before you start). 

     

    The new style will be inserted into the drawing for you to copy to your new drawing.  If you save the "OHCD Generator" file the new styles will be kept in this file for future use. 

     

     

    If you want to change the default settings in the style you can edit the source plugin named "OHCD STYLE TEMPLATE" in "OHCD Support File.vwx". You can also edit the class names in each file but you will also need to change the class settings inside the script.  Find this section in the script to edit. 

    	{ Define Class Names as Constants }
    	kClassNone       = 'A-DOOR';
    	kClassFlorOvhd   = 'A-FLOR-OVHD';
    	kClassDoorLeaf   = 'A-DOOR-OHCD-LEAF';
    	kClassDoorCan    = 'A-DOOR-OHCD-FRAME';
    	kClassDoorTrim   = 'A-FNSH-TRIM';

     

     

     

     

    OHCD Support File.vwx OHCD Generator.vwx

    • Like 3
  3. If I insert a plugin object in a drawing and the fields are not controlled by the style I can edit the instance of the plugin in the drawings fields.  

    What I would like to be able to do is:

    1. Edit the fields of a plugin that are by style with a vectorscript so every instance is edited. 
    2. If I cannot do that then I would like to be able to insert the styled plugin in the drawing and then convert it to an unstyled plugin using a vectorscript before editing the fields.

     

      Anyone know how to do either of these. 

  4. Attached is a Vectorworks file that contains a script to merge multiple lines of text into one text block.

     

    Simply select the multiple blocks of text you wish to merge and double click "Merge Text Blocks".

     

    The script will merge the text from highest y value to lowest y value. 

     

    As always I recommend saving your work prior to running any scripts.  

     

    image.png.ad314b998d17a09530164a951d2e3b6f.png

     

    """
    This script merges multiple lines of text into on text block in order of highest to lowest y value
    
    This Python Script may be freely distributed. No warranty provided.
    Use at your own risk.
    
    David Hamer, 03/31/2025
    """
    
    def makelist(H):
    	Master_List.append(H)  # adds to list
    
    Master_List = [] # defines list to contain handles to all selected objects
    Duplicate_List = [] # defines duplicate list to contain handles to all selected objects
    New_List = [] # defines final list to contain handles to all selected objects
    LongString ='' 	# defines LongString as a string
    vs.ForEachObject(makelist,"(((T=TEXT) & (VSEL=TRUE)))"); 	#Sends each selected text object to def makelist
    
    while len(Master_List) > 0:	#Goes throught the list of text objects until none are left
    		Duplicate_List = Master_List.copy()	#duplicates the Master_List to Duplicate_List
    		while len(Duplicate_List) > 1:	#Goes throught the Duplicate_List of text objects until two are left
    			pt  = vs.Get2DPt(Duplicate_List[0],1)	#gets the xy coordinates of the first item in the Duplicate_List
    			pt2  = vs.Get2DPt(Duplicate_List[-1],1)	#gets the xy coordinates of the last item in the Duplicate_List
    			if pt[1] > pt2[1]:	#Compares y cooridinates of each and removes the lowest y valued item from the Duplicate_List
    				del Duplicate_List[-1]	# in this case the last item was the lowest y value
    			else:
    				del Duplicate_List[0] # in this case the first item was the lowest y value
    				
    		New_List.append(Duplicate_List[0]) 	#appends the last remaining item in the Duplicate_List to a New_List
    		Master_List.remove(Duplicate_List[0]) #removes previously appended item from the Master_List
    
    for H in New_List: 	# Steps through every item in New_List
    	Textstring=vs.GetText(H); # Gets the Text value of the active item in New_List
    	LongString=LongString+Textstring						# Adds return character to end of LongString 
    	if  New_List[-1] != H:									# Checks to see if this is the last value in the list
    		LongString=LongString+"\n"							# Adds return character to end of LongString 
    
    vs.DSelectAll() # Deselects all currently selected objects
    vs.CreateText(LongString) # Creates a new text object from LongString

     

     

    Merge Text Blocks.vwx

    • Like 1
  5. On 10/23/2024 at 1:03 PM, BartH said:

    In the file with the most recent data, do a Save and Commit. 

    Even though the file appears disconnected with the project, the Project file still seems to see the user as having the Items checked out. 

    In the main working file, update from the Project file.

    Thanks for the tip, I will try this next crash.  

  6. While working in a project sharing working file Vectorworks crashed

     My next step was to open the backup file of my working file. 

     

    This is where the issue arises. 

    1. The backup file was no longer attached to the project file (I believe in previous versions this was not the case)
    2. The project file still has my items checked out.  
    3. There is no way for me to save my changes from the backup working file to project file.  
    4. I worked on several layers and pieces and parts of the file. 

     

    What is the recommended process for correcting this? 

     

    Fortunately for me there was no one else working in the file at this time so I was able to recreate the project file from my backup, but this is rarely the case.  

  7. 54 minutes ago, Nikolay Zhelyazkov said:

    For what you are trying to achieve I would recommend using a custom record instead of the second text field in the data tag and read from the record directly, which will be much faster and will not cause recursive calls to the data tag.

    I tried that but the record attached to the tag in the resource manager doesn't seem to want to follow the tag from the resource manager to a new drawing.

    Scratch that, I must have done something wrong.  This will work but it makes it harder to get the handle to data tag if more than one item is associated with the roof. 

  8. 4 hours ago, Nikolay Zhelyazkov said:

    This is crashing because in the script you rotate the data tag and reset it, which then loops back to the script execution from the data tag reset and ends up in an endless loop that causes a crash.

    Actually tried reducing the script to doing nothing but exporting text. It only crashes when I try to call the DATATAGFIELD('Run') value from the tag formula and only when trying to tag a roof face within a roof object. 

  9. This version is simplified so it won't crash Vectorworks. 

    You will get a message if you try to tag a roof object rather than a roof face. 

    You can only add one tag to a roof face or the tag won't work.  

     

    See the post above for locating the files in your libraries. 

     

    You can still adjust the Run value but it needs to be edited in the tag layout formula directly. 

    Both the Run and Rise values need to be adjusted.

     

    To change the Run value edit the change the value of  '12' in the Pitch formula =RUNSCRIPT(120, 'RoofSlopeAngle.vs', 'Rise', '12')

    image.png.74f88c7759f09d374ec35593d475fc68.png

    You will also need to chage the value of Run in the tag if the tag has a seperate Run Value for example.

     image.png.82d8efafc13826f159adc881153b4a5e.png

     

     

    Roof Pitches on Plan.vwx

    RoofSlopeAngle.vs

    • Like 1
  10. I have identified the issue with the crash but I don't know if there is a solution.   It is crashing because of the DATATAGFIELD('Run') part of the script when it finds the objects within a container like a roof.  Without DATATAGFIELD('Run') the rotation function will not work and theirfore is an essential part of the tag.  

    I have tried to define the criteria to omit objects that have a parent but there does not appear that data tags have this functionality at this time and data tags are supposed to select objects within a container.  

×
×
  • Create New...