Q: How do I get control over the macro-generated text on a roof plane?


para-CAD
 Share

Recommended Posts

>How does one prevent getting multiple roof planes, every time I make a revision I get a new roof plane in the schedule.

 

$tree = nil

 

In the Ruby console will reset the collection.

 

>Trying to get to the order as shown on the left of the attachment

 

MacroRoof.txt
 

>Lastly,  how can one control the numbering order of roof planes. Any help is greatly appreciated.  

 

Don't have a clue. There is no roof scheduler. All planes are equal. All I can do is sort them from the largest to smallest.

Link to comment
Share on other sites

1 hour ago, jonboy said:

How does one prevent getting multiple roof planes, every time I make a revision I get a new roof plane in the schedule. Is there something one can change or add to the macro?

 

Did you download the Macros I posted earlier in the Thread?  import the clear_hash macro, it helps force a reset of the Roof Planes ( or room info if using that Macro too ) I have it in a text box on the Attic level but that maybe not necessary ?

 

Mick.

Link to comment
Share on other sites

I would like to thank both of you, BT & Kbird for the help. I have one question, how does one change the fascia length from inches to feet - inches, thought it would safer to ask than to try messing the macro up.

 

Thanks 

1st.JPG

Link to comment
Share on other sites

On 11/3/2019 at 8:46 AM, jonboy said:

I would like to thank both of you, BT & Kbird for the help. I have one question, how does one change the fascia length from inches to feet - inches, thought it would safer to ask than to try messing the macro up.

 

Thanks 

 

 

 

To do it roughly you can /12  (to get feet) and round it up (.ceil) to the nearest ft

 

Not sure the items Fascia line is needed ??? 

 

Note the current formula ii for Eave Fascia only ...this will also show/add the Ridge for example on a Shed or mono slope roof

 

image.thumb.png.e21f1846d28c3c17301cf2d6578a173b.png

Link to comment
Share on other sites

Use the  $tree = nil command in the Ruby console or what I found that works is Micks macro just placed in TMM and then all you seem to need to do is open the Text Schedule and press OK.

 

Here it is posted separately from the package he posted earlier.

 

Mick's clear_tree_Hash.txt

 

Did you get my PM from the other day ?

Link to comment
Share on other sites

1 hour ago, Chopsaw said:

 

Here it is posted separately from the package he posted earlier.

 

Mick's clear_tree_Hash.txt

 

Well it not really mine, it was BrownTiger's info from an earlier post  (it is a standard Ruby command to clear Hashes.... in this case $tree) I used Michael's Method to deploy it originally on the Attic Level but I too have found that Opening and Closing the Schedule causes the macro to be refreshed so there is no need to go up and down the levels although that works too.

 

M.

Link to comment
Share on other sites

Hello BT,

 

I was able to follow your formatting to add additional properties to the resulting schedule.  Is it possible to format so multiple columns can be totaled in the Text Schedule on the last line much like a stock CA schedule. Additional possibilities would be ridge vent, drip edge, valley flashing, etc.  I tried several iterations but failed miserably.

 

Fascia Length Roof Text Schedule..JPG

Link to comment
Share on other sites

5 hours ago, BrownTiger said:

Like this 

 

 

MacroEaves.txt

MacroLabel.txt

 

This was for eaves fascia, you could also add up the " .gable_fascia_length" or ".ridge_vent_length", or even get the OSB (layers[1].material_data )

description: "OSB-Hrz"

formatted_size: "48"x96"x1/2"" 

quantity: 14.25

 

Thanks for the Help BT , much appreciated

 

Mick.

Link to comment
Share on other sites

  • 1 month later...
On 11/4/2019 at 9:28 AM, BrownTiger said:

Like this 

 

 

MacroEaves.txt

MacroLabel.txt

 

This was for eaves fascia, you could also add up the " .gable_fascia_length" or ".ridge_vent_length", or even get the OSB (layers[1].material_data )

description: "OSB-Hrz"

formatted_size: "48"x96"x1/2"" 

quantity: 14.25

 

Hello: Brown Tiger

 

I have made good progress with your last example. The gable fascia and ridge vent work great.

 

However I seem to be missing something in how to format the "OSB (layers[1].material_data )" to be able to retrieve and display the NVPubisher properties of description, formatted_size,quantity, etc.

 

If you have a moment could you possibly write that example into your previously posted MacroLabel.txt example for us.

 

Many Thanks, Chopsaw

Link to comment
Share on other sites

5 hours ago, Chopsaw said:

 

Hello: Brown Tiger

 

I have made good progress with your last example. The gable fascia and ridge vent work great.

 

However I seem to be missing something in how to format the "OSB (layers[1].material_data )" to be able to retrieve and display the NVPubisher properties of description, formatted_size,quantity, etc.

 

If you have a moment could you possibly write that example into your previously posted MacroLabel.txt example for us.

 

Many Thanks, Chopsaw

 

You are working with NVCollection not an Array...

>obj.layers[1].material_data.description  <- wrong

 

Get your object

material = obj.layers.to_a[1].material_data

 

to_a(*args) → array

Returns an array containing the items in enum See: https://ruby-doc.org/core-2.6.5/Enumerable.html#method-i-to_a

 

Now material.description, material.formatted_size, material.quantity should all be a valid methods. Now sure if you wanted to collect it or just display....

macro: labelRoofPlane [don't forget the Evaluate checkbox]

MacroLabel (1).txt

  • Upvote 1
Link to comment
Share on other sites

  • 2 weeks later...

I know this is a post that is way over my head at this time but I have been reading on it and more all morning and am still having some issues.  I am using the great macro all you experts hashed out:

 

==

 

referenced ? obj = referenced : obj = owner

 

if $tree.nil?

 

$tree = Hash.new { |hash, key| hash[key] = {} }

 

end

 

id="p" + obj.object_id.to_s

 

pitch = obj.automatic_label

 

area = (obj.surface_area).ceil

 

areasq = ( obj.framing_area / 100.0 ).ceil

 

slope = obj.angle.round(2)

 

#slope = (Math.atan2(obj.pitch,12.0)*180.0/Math::PI).round(2) ALT Slope Formula

 

 

#unless $tree['roofplanes'].has_value?(id)

 

items = Hash.new()

 

items['roof_plane']=id

 

items['pitch']=pitch

 

items['area']=area

 

items['areasq']=areasq

 

$tree['roofplanes'][id]=items

 

#end

 

 

 

indx = $tree['roofplanes'].keys.find_index(id)

 

result = "Roof Plane No# : " + (indx+1).to_s + "\n"

 

result += "Roof Area Sqft : " + area.to_s + " sqft" + "\n"

 

result += "Roof Area Total Sqs : " + areasq.to_s + " sq" + "\n"

 

result += "Roof Pitch : " + pitch + "\n"

 

result += "Slope Angle : " + slope.to_s + "°\n"

 

 

result

 

==

 

It is working as intended but I was hoping to have a similar macro for one of my builders who doesn't want to see as much info.  I have tried to copy and create a similar macro and only get the dreaded error.  If any of you macro gurus have a second and could help out I would be as always ever grateful for the assistance.

 

This builder wants to see:

 

Roof Area Sq. Ft. (as is in the current macro)

Roof Area Total Sqs. (as is in the current macro)

Roof Pitch (as is in the current macro)

 

I know this would just be deleting parts of the macro to remove the plane No# and slope angle.  But what I have tried to do seems to get an error so I am assuming instead of deleting something I need to change it????

 

 

Side note I have not been able to figure out the arrow placement issue.  I can make it different size and I can add blank lines before the macro to get the arrow out of the middle of the text and not being seen or looking jumbled but is there a way to get the macro to have the arrow right after the pitch line???

 

TIA for anyone who takes their valuable time with this and helps me and anyone else who can benefit with this as we try to learn the awesomeness of macros! :)

Link to comment
Share on other sites

  • 2 months later...
On 1/2/2020 at 4:52 PM, Chopsaw said:

Take a look and enjoy.

Roof Plane Label for Ryan.json

I've been trying to get this roof label information on how to create this, but when I click on the link it wont open anything and tells me that I have to have an app to open it with and I don't have any idea what app I need. Is there a way you can get the information to me? If you can email I'm davidleedesign@comcast.net thanks

Link to comment
Share on other sites

5 minutes ago, DavidKorpela said:

I've been trying to get this roof label information on how to create this, but when I click on the link it wont open anything and tells me that I have to have an app to open it with and I don't have any idea what app I need. Is there a way you can get the information to me? If you can email I'm davidleedesign@comcast.net thanks

 

Hello David,  

The file that I posted works with Chief Architect Premier.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share