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


para-CAD
 Share

Recommended Posts

I will run through one way to get there.

Open the roof plane's dbx>Object Layer Properties (Edit toolbar)>scroll down to Roofs, Labels>Text Style (it will probably be CAD Text Style>Define.

The dbx will probably open with the CAD Text Style hilighted>Edit>Character Height.

This will change the text size for all objects that use that particular text style.

You may want to create a new text style and assign the new one to the Roof, Labels layer.

There are many different ways to do this, but the above may give you a better understanding.

If the above doesn't work, post back as your settings may be different from the above.

 

You answered the second question yourself.

Link to comment
Share on other sites

You can of course access the material amounts and areas and then add that information to a text field, it just won't auto-generate unless you pay someone to write macros for your specific needs. So you could create the text field (with blank portions) the way you'd like, and then add the info at completion, once you're done with design development. To quickly find the total roof surface area (for example) group select all roof planes and go to the 'polyline' tab. There's a balance to find between paying for macros, versus the time it takes to access and accurately update information. And I think macros, like schedules, slow down the performance a bit.

Link to comment
Share on other sites

Y'all are great!

 

I was up late last night and boom, this morning I received light.  Thanks for illuminating my path.

 

Glenn...I followed your steps...BOOM!  Success.  Thanks, brother!

Created a ROOF LABELS text style so as to not screw with whatever else is reading from the default style.

 

2019-10-19 09_56_28-Window.png

Link to comment
Share on other sites

On 10/19/2019 at 10:49 AM, para-CAD said:

Y'all are great!

 

I was up late last night and boom, this morning I received light.  Thanks for illuminating my path.

 

Glenn...I followed your steps...BOOM!  Success.  Thanks, brother!

Created a ROOF LABELS text style so as to not screw with whatever else is reading from the default style.

 

2019-10-19 09_56_28-Window.png

Hey Mike, this isn't meant to be negative. Could you reduce the # of decimals in the slope to 2 places? Nothing says auto generated bs like 10 decimal places!;)

Here's an example to 1 decimal place.

image.thumb.png.82cebde568589c16f0735b75454b4fcd.png

 

 

 

  • Upvote 1
Link to comment
Share on other sites

Yes, those should be there.

I notice that your macro is now working.  But of course the only thing that's being displayed is the "automatic_label". 

$tree is a Hash that contains the other information. That's not displayed because it's not the last thing in the macro.

Link to comment
Share on other sites

#  If referenced assign obj = referenced otherwise obj = owner

referenced ? obj = referenced : obj = owner     

 

#Next create new Hash tree if  global $tree does not exists (nil)

if $tree.nil?

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

end

 

#Next we will prepare new hash map "items" with value pairs 'roof plane' = unique id, pitch = label, etc

id ="p" + obj.object_id.to_s

items = Hash.new()

items['roof_plane']=id

items['pitch']=obj.automatic_label

items['area']=obj.surface_area

 

#Next place the items this two dimensional hash map $tree['roofplanes']   (Unique Id)  = hashmap

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

 

#Display the automatic label or whatever you want to see, now that we stored the information about our roof plane 

s =obj.automatic_label

s

Link to comment
Share on other sites

Show the roof area macro

 

#initialize 

result=""

sqft=0

 

#for each roof plane

$tree["roofplanes"].keys.each_with_index do |key,index|

s= index.to_s

#concatenate all information 

result += "Plane: " + s +"\t" + $tree["roofplanes"][key]['pitch'] + " \t" + $tree["roofplanes"][key]["area"].round(0).to_s + " sq ft\n"

#sum the sqft

sqft +=$tree["roofplanes"][key]["area"].round(0)

end

 

#append the total

result += "Total: " + sqft.to_s + "sq ft\n"

result

 

Link to comment
Share on other sites

Brown Tiger,

 

How do you get $tree to contain a different hash key for each roof plane?  My experience shows that the object_id in Chief is not reliably different for different roof planes.  IOW, I am pretty sure the data for each successive roof plane will overwrite the previous.

 

I would love to be proven wrong.

 

 

Link to comment
Share on other sites

So now I've found that your macro does in fact get all the roof planes as separate in the $tree hash.  I'm not sure exactly how that's working but it's good.

 

The bigger problem is that the $tree hash grows drastically with each edit of the plan.  It needs to be refreshed from nil whenever an edit is done.

Link to comment
Share on other sites

Disclosure: I am a software developer, and this is my hobby.

 

One of the issues I have is Chief Architect they are not exposing "ChiefUUID"

 

CARoofPlane.thumb.PNG.3bd66a4e198fa680a6f60bf444004e5f.PNG

 

They should really provide true and complete Ruby access to the object [object accessor], and stop been a p*, and may be even let Ruby modify.

Every plane has this hidden value "object_id". It is never disclosed by ChiefArchitect, and appears to be immutable.

[ChiefUUID would have been better but we do with what we have]. As you can tell to form the key I just added a letter "p": id ="p" + obj.object_id.to_s

 

So as far as I can tell... all planes should be enumerated. 

 

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

 

Because, I think, the id is unique, the hash map $tree[ 'roofplanes'] should only allow ONE value for the key [id].

Unless the Ruby garbage collector is not working correctly or it needs:

 

 $tree['roofplanes'].rehash  after the assignment...

 

Now if you open multiple plans with this macro the global $tree may be populated by the different plans. 

In this case I would recommend may be make a triple hash. $tree[project_name_key][object_type_key][object_id] .?

 

Other possibility is to check $tree['roofplanes'].has_value?(id) and if so don't bother with .. Something like

 

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

  items = Hash.new()

  items['roof_plane']=id

  items['pitch']=obj.automatic_label

  items['area']=obj.surface_area

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

end

 

 

Link to comment
Share on other sites

 

17 minutes ago, ChiefPlagman said:

https://ruby-doc.org/core-2.4.0/Object.html#method-i-object_id

 

Just to be clear, object_id is provided by Ruby.

 

Thank you. I stand corrected.... It is Ruby exposed method....
 

I have looked at names ... and did not see it... My mistake

> owner

=> #<NVPublisher:0x00020b6aaa46b0 @names=["layer_set", "layer_line_weight", "layer_line_style", "layer_line_color", "layer_text_style", "layer_is_default", "layer", "drawing_group", "floor_number", "object_type", "line_weight_is_default", "line_weight", "line_color_is_default", "line_style_is_default", "line_style", "hole_area", "hole_perimeter", "visible_length", "num_lines", "is_closed", "is_hole", "fill_color_from_background", "fill_color_from_layer", "pattern_vertical_spacing", "pattern_horizontal_spacing", "custom_pattern_scale", "pattern_angle", "transparent_pattern", "fill_line_weight", "automatic_label", "suppress_label", "angle", "pitch", "rafter_info", "overhang_area_3d", "projected_overhang_area", "surface_area", "framing_area", "projected_area", "framing_perimeter", "layers", "soffit", "skylight_width", "skylight_height", "skylight_description", "skylight_size", "gable_fascia_depth", "gable_fascia_width", "gable_fascia_length", "gable_fascia_size", "eave_fascia_depth", "eave_fascia_width", "eave_fascia_length", "eave_fascia_size", "drip_edge_length", "num_downspouts", "valley_flashing_length", "ridge_vent_length", "edge_flashing_length", "sloped_edge_flashing_length", "skylight_room"]>

 

Link to comment
Share on other sites

Prior to X10 I think it was, those object id's were not persistent and couldn't reliably be used for much of anything.  They basically changed with any changes to the model.  They are now semi-persistent and don't change very often. Just beware that they still do change sometimes...most notably during undo/redo operations.

Link to comment
Share on other sites

Now I understand.

 

Ok here is the full label macro:

referenced ? obj = referenced : obj = owner

if $tree.nil?

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

end

 

id="p" + obj.object_id.to_s

 

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

items = Hash.new()

items['roof_plane']=id

items['pitch']=obj.automatic_label

items['area']=obj.surface_area

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

#end

 

 

result = "Slope Angle: " +(Math.atan2(obj.pitch,12.0)*180.0/Math::PI).round(2).to_s + "\n"

result += "Pitch: " + obj.automatic_label+ "\n"

result += "Area: " + ((obj.framing_area / 100.0 ).round(1)).to_s

result

 

Link to comment
Share on other sites

1 hour ago, ACADuser said:

 

When I try to download the PDB files I can only get the first page, not the entire document.

 

Is there a trick to this? Not familiar with pdb files.

 

If you're referring to the Plucker docs linked in the Downloads page on that site, I'm not familiar with that format or those downloads.

PDB more typically refers to https://en.wikipedia.org/wiki/Program_database

Link to comment
Share on other sites

12 hours ago, BrownTiger said:

Now I understand.

 

Ok here is the full label macro:

 

Hello BT,  Just trying to get the new revised version to work with the previously posted roof plane macro.  There seems to be a disconnect but I don't know macro's well enough to pinpoint why.  There seems to be a "4" in the new macro that looks out of place. Could that be it ?  Or does the label text macro need to be revised as well.  Also is it possible for the data to be presented in Standard Text Box with tab stops and grid lines to give the appearance of a schedule ?

 

roof_plane macro issue.JPG

 

Also still seems to be an issue when editing the roof planes and getting it to refresh.

 

Would it be possible to return the Roof Plane # in the Roof plane label something like this ?

 

2065784324_RoofPlaneLabel.thumb.JPG.1f861b206510735268d6ea5871dd3524.JPG

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