Macros vs Global Macros


buildology
 Share

Recommended Posts

Thanks Eric,

Text Marcos and Global macros.

We have a Text Macro for wall type - to change it we need to open the Text Macro editor find the Macro edit it and close it. We have lots of different Text Marcos so doing this for every one takes quit a bit of time.

So I have changed it to using Global Macros - so have set up a CAD Detail in the Project Browser that has a list of lots of different wall types and it sets a Global Macro to assign what ever Wall Type you point it to. I have done this for Roofs, Floors and Levels it all works quit well but when I first open a plan I have to open the CAD Detail which holds the setup and if I have two plans open it sometimes uses the Global Macro from the other plan. 

Hopefully that's a bit clearer??

 

 

image.thumb.png.0cd2b3e44ec0eb85510796be1a37a5ed.png

Link to comment
Share on other sites

2 hours ago, buildology said:

Text Marcos and Global macros.

We have a Text Macro for wall type - to change it we need to open the Text Macro editor find the Macro edit it and close it. We have lots of different Text Marcos so doing this for every one takes quit a bit of time.

So I have changed it to using Global Macros - so have set up a CAD Detail in the Project Browser that has a list of lots of different wall types and it sets a Global Macro to assign what ever Wall Type you point it to. I have done this for Roofs, Floors and Levels it all works quit well but when I first open a plan I have to open the CAD Detail which holds the setup and if I have two plans open it sometimes uses the Global Macro from the other plan. 

 

Nice to see that you have thought up a system to move on from Text Macros and I hope I am not premature in my assessment but I think you may be overthinking the whole thing an missing out on the specific use of Global Macros.  I would need to see a typical plan file with your system in use but I think you need to parse your data from the objects that you use in your plan otherwise I think you might be better off with Text Macros.  Global Macros are most typically used to parse information from one object and then use it to make a calculation in an unassociated object, if that makes sense.

 

It is unfortunate that Globals jump from one plan to another but I am not aware of a way to prevent that.

  • Like 1
Link to comment
Share on other sites

11 hours ago, Chopsaw said:

It is unfortunate that Globals jump from one plan to another but I am not aware of a way to prevent that.

 you can avoid this by creating an array, in which the second component of the array is the plan filename (incl path), thereby making the variable unique.

 

But it's a fair amount of work to assign it,  and check it.

 

I do it for floor area summation, but if I was to do it for all of the above I'd probably create some specific functions to populate and check..

 

you could also read and write to files, as the file would be plan specific

  • Upvote 1
Link to comment
Share on other sites

10 hours ago, SHCanada2 said:

 you can avoid this by creating an array, in which the second component of the array is the plan filename (incl path), thereby making the variable unique.

 

But it's a fair amount of work to assign it,  and check it.

 

I was sort of thinking that might be a possibility but very complex to accomplish it.  I assume the file name would need to be manually entered at some point as a reference to match to ?

Link to comment
Share on other sites

8 hours ago, Chopsaw said:

 

I was sort of thinking that might be a possibility but very complex to accomplish it.  I assume the file name would need to be manually entered at some point as a reference to match to ?

Send a View from the Plan to the Layout.  The Referenced File Name & Path can be retrieved from the Layout Box.  That way, no manual entry is required.

Link to comment
Share on other sites

9 hours ago, Chopsaw said:

I was sort of thinking that might be a possibility but very complex to accomplish it.  I assume the file name would need to be manually entered at some point as a reference to match to ?

you do not have to, you can assign the filename to a global variable on that CAD Detail page, programmatically.. The tricky part is "where" you use the values you populate, because you need to repopulate the global variable containing the current plan's filename wherever you use it (in order to determine the value for that specific plan). If it is all on the same CAD Detail, then it is simple

Link to comment
Share on other sites

57 minutes ago, buildology said:

The CAD detail window is only the setup(to assign the Global Macro) and then it is used in the Plan View, Elevation Views and in other CAD Detail windows. It's all in the same .PLAN file

in this case if you wanted to use the plan filename as a key search, you would then need to assign plan filename to the global variable on the plan view and elevation views and other CAD detail windows(as that is the key to search for the proper macro values for that plan) For my floor area macro, it is just a pline box that sits there in plan view (and it is in my template file). So in your case, plan view and CAD details are probably simple because you could put the pline box on your template file, but elevation...that would be a PIA to copy the pline box around. I suppose if you used the label for the elevation you could put it in there by default. But still a lot of effort. .. this may need some more pondering.... 

Link to comment
Share on other sites

well I did find a way to dynamically pass the filename as a key

 

How I got it to work:

On the CAD detail, create a global hash.

For each parameter (roof, wall, etc), add it to the hash, along with the filename and the value. These first two are the keys

 

On the elevation, the label can use the dynamic filename, parameter of interest to get the value.

 

The only limitation  see is that you have to go to the CAD detail page when you first open the file in order to populate the hash, but I assume you have to do that today to populate the global variables

 

Link to comment
Share on other sites

On 10/11/2022 at 1:06 PM, buildology said:

The CAD detail window is only the setup(to assign the Global Macro)

 

As some of the others have already pointed out, what you're talking about is actually a global variable, not a global macro.  It would help if you were to communicate in the approrpiate terms.  Chief does have some of what they call global macros, but those are a different thing entirely.

Link to comment
Share on other sites

On 10/9/2022 at 11:16 PM, Chopsaw said:

It is unfortunate that Globals jump from one plan to another but I am not aware of a way to prevent that.

 

They don't actually jump from one plan to another.  The issue is simply that there's only one global memory to go along with any given instance of Chief.  So, for all intents and purposes, any global variable can only have one value at any given time.

Link to comment
Share on other sites

11 hours ago, SHCanada2 said:

The only limitation  see is that you have to go to the CAD detail page when you first open the file in order to populate the hash, but I assume you have to do that today to populate the global variables

 

You've highlighted the key issue and that is this.  A global variable must be properly defined before you can use the desired value in any given view.  In my opinion, the best way to ensure this happens is to include the variable defining macros in any view that they are being used in.  They can be placed off to the side, they can be made invisible, they can be made super small, they can be hidden...any number of things, but if the macros that set the desired value are placed in the same views where you are using the desired value then you'll always have the most current value as it pertains to that particular plan.

 

In the specific scenario mentioned by the OP, that whole setup can potentially just be part of a CAD Block.  That CAD Block can simply be dropped into any view where the macros are used.  Update the CAD Block, and all views that contain the CAD Block will be updated as well. 

 

Yes, there are various other methods of dynamically naming or organizing variable values so that the value is linked to the specific plan.  You can use the actual plan name, you can make a habit of incrementing a unique plan number with each new plan, you can simply copy and paste your macro definitions from a spreadsheet that assigns unique names to your variables, you can use macros that reference an external file (that again uses unique variable names for each plan), and so on.  I personally don't think however that its worth jumping through all the hoops when you can just make sure your global defining macro(s) are present in the views where the values are being used. 

Link to comment
Share on other sites

1 hour ago, Alaskan_Son said:

the best way to ensure this happens is to include the variable defining macros in any view that they are being used in.

but the OP has a text box on an elevation driven from a macro. He would have to drop in the macro assignment onto each elevation he wanted the result of the macro on, would he not? If so, it might be quicker just to copy and paste a hardcoded text box and forget about a macro?

 

it was an interesting exercise to see what it would take to put it in a hash, and it is not much

$confighash[[filename, "Roof"]] = label

 

instead of what I assume the OP has, something along the lines of

$roof=label

 

Link to comment
Share on other sites

slick

 

...as a feature, you could consider including the assignment to a hash, and retrieval from the hash, thereby eliminating the need to shut down to print

 

the assignment, as posted above, is not much different, but the retrieval using a text box (as opposed to a pline label) is a bit more complicated from what i have discovered so far. I'm still looking to see if I can get it to work without needing a macro. 

 

If, and it is a big if, it could be simple enough, it would eliminate the global variable problem, for those that have the problem. For me I have the CAD detail variables assigned in their own macros, so they are guaranteed to be correct within the plan. (ie. I have a macro named "DET-Fascia" and the only thing in it is "Metal Fascia"). But I can certainly see the appeal of the graphical editor you and the OP have. No need to type. 

Link to comment
Share on other sites

I am still trying to learn all this so sorry for the confusion.

Yes, I know it would be easier to get someone else to do it and have used Alaskan_Son services before and it was a great help but I am always updating and tweaking our systems so need to learn it myself.

 

On 10/10/2022 at 12:17 PM, buildology said:

Hi All,

I have been playing around with Global Macros for wall notes and elevation heights but run into issues when I have two plans open.

Is there a way to assign a value to a standard macro in the same way you do for Global macros?

Hi All,

I have been playing around with Global Variables for wall notes and elevation heights but run into issues when I have two plans open.

Is there a way to assign a value to a standard Text Macro in the same way you do for Global Variables?

Link to comment
Share on other sites

2 hours ago, SHCanada2 said:

slick

 

...as a feature, you could consider including the assignment to a hash, and retrieval from the hash, thereby eliminating the need to shut down to print

 

the assignment, as posted above, is not much different, but the retrieval using a text box (as opposed to a pline label) is a bit more complicated from what i have discovered so far. I'm still looking to see if I can get it to work without needing a macro. 

 

If, and it is a big if, it could be simple enough, it would eliminate the global variable problem, for those that have the problem. For me I have the CAD detail variables assigned in their own macros, so they are guaranteed to be correct within the plan. (ie. I have a macro named "DET-Fascia" and the only thing in it is "Metal Fascia"). But I can certainly see the appeal of the graphical editor you and the OP have. No need to type. 

We could split this in two.

 

For wall label and CAD detail.

It's not so much the typing is more we have over 80 Text Macros that are assign at the beginning of the project. (We have an Excel Sheet that our Admin person converts to a .JSON file)

But while our staff are working on the project they need to update and change other Text Macros and I find it frustrating to find the Text Macro and then 3-4 clicks so I was trying to have all the information in one place that was easy to read and change.

We could use the Excel system for this but I am trying to keep everything in Chief.

 

Assigning a Hash (if it works??)

This would be prefect for things like our Site Calculations and Elevation heights. 

Link to comment
Share on other sites

FWIW, 

 

I don't understand why you aren't just using a Wall Schedule for the Walls in your model.  Assuming that you have your Wall Definitions set to use the correct materials and those materials are named & sized appropriately (not Chief's standard names) then everything will be taken directly from the model and you won't need to use anything else.

 

285707173_WallScheduleExample.thumb.JPG.6d83b6f2975e29b0d26afb182cb0a58f.JPG 

Note that the materials in the Wall Types for the above Schedule are not what I would normally name them - those are mostly Chief's standard materials. 

 

I do use $Global Hashes for some things - Site Area Analysis for example where I get areas directly from Closed Polylines - but otherwise I tend to avoid extra $Globals that aren't fixed data - such as structural information (standard properties, etc).  IOW, things that Chief doesn't otherwise provide.

 

It just seems to me that you're making it more complex than it needs to be.  The Chief Model has an enormous amount of data available.  Adding extra data entry doesn't make sense to me.

 

I know I'll probably get slammed for this post - but so be it.

  • Upvote 1
Link to comment
Share on other sites

2 hours ago, buildology said:

It's not so much the typing is more we have over 80 Text Macros that are assign at the beginning of the project. (We have an Excel Sheet that our Admin person converts to a .JSON file)

But while our staff are working on the project they need to update and change other Text Macros and I find it frustrating to find the Text Macro and then 3-4 clicks so I was trying to have all the information in one place that was easy to read and change.

I'm not sure I understand, the screenshot you posted shows you assigning values to global variables by moving the pointer to different options. where does excel and the json file come into play?

Link to comment
Share on other sites

49 minutes ago, SHCanada2 said:

I'm not sure I understand, the screenshot you posted shows you assigning values to global variables by moving the pointer to different options. where does excel and the json file come into play?

I was explaining why I don't just use Text Macros as it takes to lot. We have the basic roof, window and floor and we can just drag the pointer to the one we want which, I think you understand want I trying to achieve it was more for other people.

If we need to change it we can just click on the box the Global Variable is pointing to and change it there.

2 hours ago, Joe_Carrick said:

FWIW, 

 

I don't understand why you aren't just using a Wall Schedule for the Walls in your model.  Assuming that you have your Wall Definitions set to use the correct materials and those materials are named & sized appropriately (not Chief's standard names) then everything will be taken directly from the model and you won't need to use anything else.

 

285707173_WallScheduleExample.thumb.JPG.6d83b6f2975e29b0d26afb182cb0a58f.JPG 

Note that the materials in the Wall Types for the above Schedule are not what I would normally name them - those are mostly Chief's standard materials. 

 

I do use $Global Hashes for some things - Site Area Analysis for example where I get areas directly from Closed Polylines - but otherwise I tend to avoid extra $Globals that aren't fixed data - such as structural information (standard properties, etc).  IOW, things that Chief doesn't otherwise provide.

 

It just seems to me that you're making it more complex than it needs to be.  The Chief Model has an enormous amount of data available.  Adding extra data entry doesn't make sense to me.

 

I know I'll probably get slammed for this post - but so be it.

No Joe your not going to get slammed I think ever day if I just making to complicated but I am always trying to find better ways to do things. I think I on version 3 of our 2022 update.

Regarding wall schedule we do use them and it works really well but how do I get that information to elevations?

I have set up around 100 different wall types in the library.

In Object Information/Description Field holds a short name (proposed bevel-back H3.1 timber weatherboard cladding on cavity system) this is used in the Concept plans in the Wall Schedule and on Elevations. In the Object Information/Manufacturer Field holds the long name(proposed external timber framed wall with 90x45mm H1.2 SG8 studs @ 600mm crs. and nogs @ 800mm crs., clad with H3.1 timber bevel-back weatherboard on cavity system) this is used in working drawing in a second schedule.

To populate Wall Type W1(in the screen shot I attached) so we can use the short description anywhere we have a Global Variable in our library which you drop on you plan and point to the wall we want. But you can't do the for roofs or window so that's why I set it up in the CAD detail with the pointing arrows. It all works well as long as you don't open other plan and with the amount of staff using the system it needs to work without issues.    

 

Link to comment
Share on other sites

19 minutes ago, buildology said:

It all works well as long as you don't open other plan and with the amount of staff using the system it needs to work without issues.    

 i think I have it working robustly, but you will need to evaluate if it is worth the effort.

 

I've a couple more things to try to see if I can get it to work macro free. If not, the overhead will be creating a macro for each global variable (create it once and then not touch it. (you will still use your graphical tool to change the values)

 

 

 

 

 

Link to comment
Share on other sites

Here's a couple of pics of Elevations that are labeled with macros. 

Elevation_labeled.thumb.jpg.d59648ad48d4982ad28615b03c0d496b.jpg

 

Elevation_labeled_2.thumb.jpg.e1ebfc505b0ff2969df6db5f217b3511.jpg

 

These macros were written to provide the labels for:

  • Floor Plans
  • Roof Plans
  • Elevation Views
  • Wall Schedules

They specifically provide a slightly different set of information depending on the view type. (ie: LayerSet)

Almost all of my annotation is done using macros that get their data from the objects themselves.

 

The Section, Elevation & Detail Callouts are all coordinated via the attributes and Chief built-in macros.

 

It can be done.  ;)  It just takes time and a full understanding of what's available.

 

  • Upvote 1
Link to comment
Share on other sites

22 hours ago, SHCanada2 said:

but the OP has a text box on an elevation driven from a macro. He would have to drop in the macro assignment onto each elevation he wanted the result of the macro on, would he not? If so, it might be quicker just to copy and paste a hardcoded text box and forget about a macro?

 

No, not at all.  Read my post again.  Specifically this part...

 

On 10/13/2022 at 8:32 AM, Alaskan_Son said:

In the specific scenario mentioned by the OP, that whole setup can potentially just be part of a CAD Block.  That CAD Block can simply be dropped into any view where the macros are used.  Update the CAD Block, and all views that contain the CAD Block will be updated as well. 

 

You place the required macro(s) into the required views in your template plan.  Once and done.  From that point forward, all you do is change the CAD Block or macro definition in  a single place and any/all views that use any associated global variables will be updated as well.  Because the defining macros live in the views where the variables are being used, the variables will always be accurate. 

 

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