Jump to content

The Hamma

Member
  • Posts

    415
  • Joined

  • Last visited

Posts posted by The Hamma

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

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

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

  5. I revised these tags to take advanage of new data tag features of Vectorworks 2025. 

    The tags will now rotate with the roof slope automaticaly.  With this ability I added a new tag to show the direction of the roof slope down. 

     

    Attached are two files.  One contains the data tags Roof Slope Arrow.vwx and the other contains the companion script RoofSlopeAngle.vs. For these tags to work you need to place the companion script RoofSlopeAngle.vsin the "\Libraries\Defaults\Reports_Schedules" in your USER, WORKGROUP or APPLICATION folder. ( Vectorworks restart may be necessary).  

    I also recommend placing Roof Slope Arrow.vwx in "\Libraries\Annotations\Data Tag (styles)\Architecture Space" in your USER, WORKGROUP or APPLICATION folder.  

     

    (Warning: This tag currently will crash your drawing if you attempt to use it on a Roof object instead of a Roof Face.  Be sure to ungroup your Roof object before taging.  See current solution below)

     

    image.png.12261d8606d484616171d27c04d2f4de.png

    • Like 3
  6. I created data tags for displaying roof pitches on a roof plan. 

     

    Important: (These tags only works on roof faces so you will need to ungroup your roof to add the tags and the tag must be associated with a roof face).

     

    Attached are two files.  One contains the data tagsRoof Pitches on Plan.vwx and the other contains the companion scriptRoofPitch_12.vs. For these tags to work you need to place the companion script RoofPitch_12.vs in the "\Libraries\Defaults\Reports_Schedules" in your USER, WORKGROUP or APPLICATION folder. ( Vectorworks restart may be necessary).  

    I also recommend placing Roof Pitches on Plan.vwx in "\Libraries\Annotations\Data Tag (styles)\Architecture Space" in your USER, WORKGROUP or APPLICATION folder.  

     

     

    Screenshot2024-08-31093849.thumb.png.e59bf23f79c524fa8812090d74e12a47.png

    • Love 3
  7. On 8/15/2024 at 2:25 PM, Pat Stanford said:

    Rather than trying to do the whole thing in Worksheet functions, you are probably better off going to VS/Python and putting all the calcs into a single Worksheet Script. Then you only have one script to run to get your Data Tag output rather than multiple scripts and a bunch of Worksheet stuff.

    Thanks again.  Everything is working great.  I had to create two data tags (one is "Arc Bearing" and the other is "Arc Opposite Bearing") for the arcs because the bearing Northing can't be controlled with the direction that the arc is drawn.  

    Also I did put theArcPoints.vs  in the  Reports & Schedules folder in Default content in my workgroup folder. 

     

    Updated 08/16/2024 bug fixes

     

    Screenshot2024-08-15154343.png.5dcf5a0cc8dfeb945d913d11c3eb870c.png

     

    Arc Bearing.vwx

    • Like 2
  8. For the Arc I was able to calulate the Radius, Diameter, and Chord Length, but since the start and end angles are not reported or many of the x y corrdinates I am unable to determine the angle of the chord.  See attached drawing for reference. It seems to me that there should be some formula out there to calculate this. 

     

    image.thumb.png.cd569238db0037e03eae6b2b4246797b.png

    ARC DATA TAG.vwx

  9. Ok so when looking at a line I was able to write a worksheet function to give the correct bearings to a line in vectorworks. but even if I replace the if's with WS_IF the data tag only reports the name of the tag.  Any ideas of what is wrong with the Data tag forumla?

     

    Worksheet formula

    =IF((ANGLE>=0), IF((ANGLE=90), CONCAT('N 0°'), IF((ANGLE<90), CONCAT('N ', TRUNCATE(90-ANGLE, 0), '° ', INT((90-ANGLE-INT(90-ANGLE))*60), ''' ', ROUND((((90-ANGLE-INT(90-ANGLE))*60)-INT((90-ANGLE-INT(90-ANGLE))*60))*60), '"', ' E'), CONCAT('N ', TRUNCATE(ANGLE-90, 0), '° ', INT((ANGLE-90-INT(ANGLE-90))*60), ''' ', ROUND((((ANGLE-90-INT(ANGLE-90))*60)-INT((ANGLE-90-INT(ANGLE-90))*60))*60), '"', ' W'))), IF((ANGLE=-90), CONCAT('S 0°'), IF((ANGLE>-90), CONCAT('S ', TRUNCATE(90+ANGLE, 0), '° ', INT((90+ANGLE-INT(90+ANGLE))*60), ''' ', ROUND((((90+ANGLE-INT(90+ANGLE))*60)-INT((90+ANGLE-INT(90+ANGLE))*60))*60), '"', ' E'), CONCAT('S ', TRUNCATE(ANGLE-ANGLE-ANGLE-90, 0), '° ', INT((ANGLE-ANGLE-ANGLE-90-INT(ANGLE-ANGLE-ANGLE-90))*60), ''' ', ROUND((((ANGLE-ANGLE-ANGLE-90-INT(ANGLE-ANGLE-ANGLE-90))*60)-INT((ANGLE-ANGLE-ANGLE-90-INT(ANGLE-ANGLE-ANGLE-90))*60))*60), '"', ' W'))))

     

    Data tag Formula

    #WS_IF((ANGLE>=0), WS_IF((ANGLE=90), CONCAT('N 0°'), WS_IF((ANGLE<90), CONCAT('N ', TRUNCATE(90-ANGLE, 0), '° ', INT((90-ANGLE-INT(90-ANGLE))*60), ''' ', ROUND((((90-ANGLE-INT(90-ANGLE))*60)-INT((90-ANGLE-INT(90-ANGLE))*60))*60), '"', ' E'), CONCAT('N ', TRUNCATE(ANGLE-90, 0), '° ', INT((ANGLE-90-INT(ANGLE-90))*60), ''' ', ROUND((((ANGLE-90-INT(ANGLE-90))*60)-INT((ANGLE-90-INT(ANGLE-90))*60))*60), '"', ' W'))), WS_IF((ANGLE=-90), CONCAT('S 0°'), WS_IF((ANGLE>-90), CONCAT('S ', TRUNCATE(90+ANGLE, 0), '° ', INT((90+ANGLE-INT(90+ANGLE))*60), ''' ', ROUND((((90+ANGLE-INT(90+ANGLE))*60)-INT((90+ANGLE-INT(90+ANGLE))*60))*60), '"', ' E'), CONCAT('S ', TRUNCATE(ANGLE-ANGLE-ANGLE-90, 0), '° ', INT((ANGLE-ANGLE-ANGLE-90-INT(ANGLE-ANGLE-ANGLE-90))*60), ''' ', ROUND((((ANGLE-ANGLE-ANGLE-90-INT(ANGLE-ANGLE-ANGLE-90))*60)-INT((ANGLE-ANGLE-ANGLE-90-INT(ANGLE-ANGLE-ANGLE-90))*60))*60), '"', ' W'))))#

     

     

    Result from the worksheet of four lines each pointing to a different quadrant

    image.png.b2c9bcb83e11e305254a5d6d7d723cee.png

     

  10. 2 hours ago, rDesign said:

    Isn’t most of this information included in the preformatted Property Line reports? Or are the segment records only attached if you created the arcs as a part of a ‘property line’ object?

    In my Opinion the Property Line object is an overcomplicated tool for creating property lines.  The property lines are simply lines from one point to another with or without radius.  The property line tool is not the way any engineer would divide a property.  This is for inputting data that someone else has already created. I never use it.   

    • Like 1
  11. Ob

    2 hours ago, DomC said:

    Aha, then you could use this one. I like this idea. Also for myself i have tons of scripts and this one can help execute them fast with a menu command and one single click.

     

    Obviously you are very fluent in Python.  Many of my scripts are also in Vectorscript.  I have not been able to find a command to run an external vectorscript other than the "DoMenuTextByName('Run Script',00);" but that requires you to choose the script in a dialog box.  

     

  12. 5 hours ago, DomC said:

    Two open things:
    1. I think the script have to be temporary imported to run and deleted after which looks not very elegant
    2. "vs.PythonExecute(str(vs.GetScriptResource(script_name)[1]))" runs a python script. I do not know how to run pascal code here.

    I was thinking more using this to run external pyton script that was in a text file. 

    import _main
    	_main.execute()

    https://developer.vectorworks.net/index.php/Python_Sample_Menu_Command

     

  13. On 8/11/2024 at 4:28 PM, DomC said:

    have an own approach of organizing through one single palette, which have Favorite Scripts but can access to non-favorite scripts as well over the separator. Also there is a dialog, which allows to add and remove script to the favorite palette. Not finished yet (i will have to implement some presets to easy reset palettes to default)

    This is so cool! 🤯 I wish I could read it, LOL, and I had a better understanding of how this works. 

     

    I have a file folder filled with external scripts and I would love to be able to adapt your dialog box to invoke those scripts so I could just have one script built into the workspace and have all the scripts live in the workgroup folder.  That way they could be invoked from anywhere without having to add each one to the workspace or the drawing.  

  14. On 8/2/2024 at 8:00 AM, heavy manners said:

    Is there any work on resolving this from the VWX team?

    Not sure but my solution was to use a symbolic link like Pat suggested. 

     

    At the Command prompt. 

    PC (change the first path with your user folder path for Notes after you delete the existing notes folder and the second path is the location of the notes folder in your workgroup folder.)

    mklink /J "C:\Users\David\Documents\VWUser\2024\Libraries\Defaults\Notes" "C:\VWWorkgroup\2024\Libraries\Defaults\Notes"

     

    Mac (is the opposite change the first path with your workgroup folder path for Notes and the second path is the location of the notes folder in your user folder after you delete the existing notes folder) 

    sudo ln -s  "/Users/David/Documents/VWWorkgroup/2024/Libraries/Defaults/Notes" "/Users/David/Library/Application Support/Vectorworks/2024/Libraries/Defaults"

     

    • Like 2
  15. Attached is a Neon Path tool.  I requires that you add the tool to your workspace and add the resource file to your user or workgroup folder.  

     

    Put Neon Path.vso into your User or Workgroup folder at ..\Plug-ins\

    Put NeonClasses.sta into a new folder named "Neon" your User or Workgroup folder, the path will be ..\Libraries\Defaults\Standards\Neon\  

    Add "Neon Path" to your "Visulalization" palette.

    NeonClasses.sta is required for the colors to work as the color is dependent on the Class color and texture. 

    The neon texture uses the class color.  The LED texture only uses the texture.  

    The true effect of the tool will only be present in renderworks renderings and is best shown in interior situations.  See sample file for an example. 

     

    NeonPic.png.ae4ccc2fa1ff85f18c1c74d562a3feae.png

     

    Save your work before you use the tool as it is provided with no warranty. Tool may be share freely. 

    Neon Sample.vwx

    • Like 3
  16. The attached script will Copy a Section Viewport to Standard Viewport (only works on sheet layers).  

    To operate the script, it must be added to your workspace.  

    Only operates on selected Section Viewports.  

    Once you invoke the command it will ask you if you want to "SAVE HIDDEN LINE VIEW OF BACKGROUND" 

    If you select yes, it will convert the layers referenced in the viewport to a background of the new viewport.  

    It will copy all the annotations from the Section Viewport to the Standard Viewport. 

    The new viewport will have no layers active but will have all classes active. 

    It will assign the following annotation items to the following classes.  (Can be edited in parameters)

    1. Drawing Labels: Classed to “A-ANNO-LABL”
    2. Redlines: Classed to “A-ANNO-REDL”
    3. Dimensions: Classed to “A-ANNO-SDIM”
    4. Nonplot: Classed to “A-ANNO-NPLT”

    All other annotations will be classed to “A-ANNO-PAGE”

    Background classes will remain in their original classes. 

     

    The Section Viewport number will be prefixed with "Old-" and the new Viewport will have the Seciton Viewports original number. 

    It will place the new Viewport above the Section Viewport.

     

    Save your work before invoking script.  Script is provided with no warranty and is free to use and distribute. 

     

    Image below (Section Viewport on the left, Standard Viewport on the right) 

    image.thumb.png.dad7eeb88e5ac04fc403b12d74460779.png

     

    Copy Sect.VP to Std.VP.vsm

    • Like 2
×
×
  • Create New...