Jump to content

The Hamma

Member
  • Posts

    360
  • Joined

  • Last visited

Posts posted by The Hamma

  1. 6 hours ago, Tom W. said:

    I'm getting weird things going on when I change the document units to millimetres which I don't seem to be able to correct... 

    It appears that the records in the symbols are not converting the units correctly when the drawing is converted to mm.  I have to multiply every unit by 304.8 which is feet to mm factor.  Let me see what I can do.  

    • Like 2
  2. I have a Number(Dimension) record attached to a symbol.  When I use GetRField to get the value of that dimension it returns a STRING.  The value is ( 4" ).  When I use Str2Num that value becomes 0.  Is there a way to convert STRING Dimensions into REAL numbers?

     

    If I use General Number format it works fine but then I have to keep all my units in inches rather than feet and inches. 

     

    Also I would like to let it use Document Units so I don't think looking for the ' or " unit mark would be helpful.  

     

    image.png.cc8678dbbdb165770d6e4345259db236.png

  3. @C Beard

    I have a Synology Diskstation and I found that it not wise to link Vectorworks to the Workgroup folder on a shared synology drive.  There are some issues with adding resources to the files when they are being linked this way.  The best way to do this is to use Synology Drive and create a synced copy of the workgroup folder on your local computer.

     

    You can also put uncategorized files in the Synced copy of the workgroup {Favorites} folder.

     

    I store everything in our workgroup folder.
     

     

    image.png.aff4259c38b85d3b944c3b3482ea14af.png

     

     I also store my keynote libraries and some other settings in the workgroup folder but Vectorworks only looks in the user folder for these items so I create a sybmolic link to those folders to my user folder. Below are the command lines that create them. I have my User directory located in my "Documents" folder rather than my %appdata% folder.  The " The {C:\Users\David Hamer\Documents\VWUser} need to be edited to the path of the local user's VW User directory and the {D:\VWWorkgroup\} need to be edited to the Synology Drive synced directory.   These commands need to be executed at the CMD prompt with Adminstrator rights. 

     

    rmdir "C:\Users\David Hamer\Documents\VWUser\2023\Libraries\Defaults\Notes"
    mklink /D "C:\Users\David Hamer\Documents\VWUser\2023\Libraries\Defaults\Notes" "D:\VWWorkgroup\2023\Libraries\Defaults\Notes"
    
    mkdir "C:\Users\David Hamer\Documents\VWUser\2023\Settings\Select Similar"
    mklink /D "C:\Users\David Hamer\Documents\VWUser\2023\Settings\Select Similar\Saved Settings" "D:\VWWorkgroup\2023\Settings\Select Similar\Saved Settings"
    
    del "C:\Users\David Hamer\Documents\VWUser\2023\Settings\Eyedropper Tool"
    mklink /D "C:\Users\David Hamer\Documents\VWUser\2023\Settings\Eyedropper Tool" "D:\VWWorkgroup\2023\Settings\Eyedropper Tool"
    
    Copy "D:\VWWorkgroup\2023\Plug-ins\Common\Data\PubliemNames.xml" "C:\Users\David Hamer\Documents\VWUser\2023\Plug-ins\Common\Data\PubliemNames.xml" 
    
    mklink /d "C:\Users\David Hamer\Documents\VWUser\2023\Settings\DWG_DXF\Export" "D:\VWWorkgroup\2023\Settings\DWG_DXF\Export"

     

    Also looking at your path it seems very long.  Windows has a file name and path limit of ~256 characters.  So if the file name and path exceed this limit Windows cannot write to that file. 

    image.thumb.png.414cc99780afeba3c7b59423eb5429b9.png

    • Like 1
  4. 10 minutes ago, Pat Stanford said:

    At least in my version of VW2023, there is not folder 'Defaults:Railing Fence:Pickets'. 

     

    I added the "Pickets" folder to my library.   I have a resource library file that needs to be added to that directory for my script to pull symbols from. 

     

    For experimental purposes I changed it to 'Defaults:Railing Fence' and it worked.  Strange!

  5. 8 minutes ago, Pat Stanford said:

    Plug-in Object not a script

    Sorry, yes it is a Plug-in Object and the parameters are defined.   It's very odd.  Never had that happen before I was working with the three samples attached to this thread.  

  6. 1 hour ago, Jesse Cogswell said:

    Actually, I added that exact functionality to the plug-in back in June.  I've attached newest iteration of the example plug-in.  You'll want to look at the kObjOnWidgetPrep event.  Not as elegant as a symbol picker, but far simpler to code.

     

    When I edit line 106

    		resList:=BuildResourceList(nResType,13,'Defaults:Railing Fence:Pickets',numItems);
    		AlrtDialog(concat(numItems));

     

    The numItems = 43 but only one symbol shows up in the picker. 

    Not sure what you are doing with the parents but is it restricting the view to only the root of the current drawing?

     

    Also get this error almost everytime I edit the script. I have to restart Vectorworks everytime I get the error. 

    image.png.bac68d78e877ae35d39af4e0ea5c7d11.png

     

  7.  

    On 7/3/2023 at 1:32 PM, Jesse Cogswell said:

    To filter to just symbols in the current drawing, you would treat it like a Resource List, using:

    vsoButtonGetResource('SymbolName',kSymbol,0,'');

     

    Jesse:

    Thanks, I do want to see the current drawing as well as the symbols at 'Defaults:Railing Fence:Pickets'.  I am only trying to filter out the rest. 

     

    I am able to build the resource list.  Would there be another way to just pick a symbol from the resource list?

     

    Currently in my scripts OIP I am just typing in the name of the symbol I would like to use.   I'm trying to add a symbol picker. 

  8. Trying to filter the resource browser but I am having trouble.  

     

    result:=vsoButtonGetResource('SymbolName', kSymbol, 13, '')

    Doesn't filter anything. 

     

    but:

    result:=vsoButtonGetResource('SymbolName', kSymbol, 13, 'Defaults:Railing Fence:Pickets')

    is filtering everthing but open drawings and favorites.

     

    How can I get this to filter everthing but symbols in the current drawing and symbols in my Workgroup Folder at 'Defaults:Railing Fence:Pickets'?

  9. So using the "Data Manager" I can assign a record to a "Title Block Border" but I only want to assign the record if this formula is true:

     

    =if('Title Block Border'.'Current Revision Number'>0,____,)

     

    I have added this formula to the criteria with different options in the True value but none seem to attach the record.  Only when I leave the formula completly blank will the record attach. 

     

    Any ideas?

     

  10. When using the publish dialog it would be great to add an option that would "exclude subfolders" when pressing the {Select Folder} button for "Add Items form Other Files" option. 

    Often we keep archived files in a an archive folder inside the job folder.  I never need to look deeper than the job folder for sheets to add to the publish dialog. 

  11. On 12/31/2022 at 11:53 AM, Jesse Cogswell said:

    Here you go.  This script will open up a dialog window so you can select the target class.

     

    Thanks, I added a criteria dialog to your script so the selection criteria is defined by the script prior to selecting the target class.

     

    PROCEDURE ChangeTextClass;
    
    VAR
    
    	CriteriaInput,targetClass:STRING;
    	Pass,dialog,layoutDialog:LONGINT;
    	check:BOOLEAN;
    
    PROCEDURE Execute(h:HANDLE);
    
    {Changes class of given object to targetClass}
    
    	BEGIN
    		SetClass(h,targetClass);
    		ResetObject(h);
    	END;
    
    FUNCTION DrawDialog(DName:STRING) : LONGINT;
    
    {Creates dialog box and returns dialog ID}
    
    	CONST
    	
    		kClassWidth = 25;
    
    	VAR
    	
    		dia:LONGINT;
    	
    	BEGIN
    		dia:=CreateLayout(DName,FALSE,'OK','Cancel');
    		
    		CreateStaticText(dia,11,'Select Target Class',-1);
    		CreateClassPullDownMenu(dia,21,kClassWidth);
    		
    		SetFirstLayoutItem(dia,11);
    		SetRightItem(dia,11,21,0,0);
    		
    		DrawDialog:=dia;
    	END;
    
    PROCEDURE DialogHandler(VAR item,data:LONGINT);
    
    {Handles dialog box}
    
    	VAR
    	
    		int:INTEGER;
    
    	BEGIN
    		CASE item OF
    			SetupDialogC:
    				BEGIN
    				END;
    			1: {OK}
    				BEGIN
    					GetSelectedChoiceInfo(dialog,21,0,int,targetClass);
    
    					check:=TRUE;
    				END;
    			2: {Cancel}
    				BEGIN
    					check:=FALSE;
    				END;
    		END;
    	END;
    
    BEGIN
    	Pass:=EditCriteriaWithUI(CriteriaInput);
    	dialog:=DrawDialog('Select Text Class');
    	layoutDialog:=RunLayoutDialog(dialog,DialogHandler);
    	
    	IF(check) THEN ForEachObject(Execute,CriteriaInput);
    	
    	ReDrawAll;
    END;
    
    Run(ChangeTextClass);

     

  12. Here is a tool I made for creating a schematic wood truss.  There is no engineering or structural calculations involved in this tool so use at your own risk and have your truss designs engineered.  Do not rely on this tool to design your truss.  You need to add the "Schematic Wood Truss" tool to a tool palette.  The tool is in the "Hamer" group. 

     

     

    1.  High side overhang only applies to single slope Howe truss. 

    2. To create a scissor truss you need to add a ceiling pitch

    3. To create a box truss you need to set both ceiling and roof pitch to "0"

     

     

    image.thumb.png.737584bc2c3a795ba0d18a4a71643ad0.png

    Schematic Wood Truss.vwx Schematic Wood Truss.vso

    • Like 2
    • Love 1
×
×
  • Create New...