Jump to content

Roof Pitch Data Tags for Roof Plans


Recommended Posts

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
Link to comment
  • 2 weeks later...

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

Edited by The Hamma
  • Like 3
Link to comment

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.  

Link to comment

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

Edited by The Hamma
  • Like 1
Link to comment
  • Vectorworks, Inc Employee

Hello @The Hamma,

 

What you are doing here is quite dangerous and the crash that appeared confirms this. 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. Not really sure if we can do anything about it because you are forcing this endless loop from the script. We will analyze it to see if anything can be done.

 

Best Regards,

Nikolay Zhelyazkov

  • Like 2
Link to comment
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. 

Edited by The Hamma
Link to comment
  • Vectorworks, Inc Employee
30 minutes ago, The Hamma said:

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. 

- Yes, I was able to narrow this down and have a fix prepared for the crash. Still, I do not recommend using DataTagField inside of data tags because it can call back the data tag and cause endless loops. 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.

Link to comment
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. 

Edited by The Hamma
Link to comment

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.

×
×
  • Create New...