Macros


bernie
 Share

Recommended Posts

boiler template macros ...

ok hows this for a cool idea,

 

we have multiple external text files called "data1.txt" "data2.txt", "data3.txt" etc in the file system folder for each project.

 

with chief and ??? (ruby?) we can supposedly read a selected file either line by line, or the whole text file, yes?

 

now, we have some magic code that some awesome soul is going to enlighten me with that can read /import the text data, and we get this external data and copy it "inside" chief into user macro's. 

in this manner we can:

 

a) create UPDATEABLE boiler plate notes. B)

B). import client data (externally) into chief

c) boiler plate notes are split into multiple .plan layerset/annosets. eg say something on the floor plan page, and also say the same thing on the elevations page. without having to

     maintain 2 different sets of text and make sure we are not contradicting ourselves.

 

and as a step 2: (for example) use some boolean operators...

 

IF (foundation type) = (slab) THEN use (boiler plate notes for slab) in .plan file, anno set foundations, etc

IF (foundation type) = (subfloor) THEN use (boiler plate notes for subfloor) in .plan file, annot set foundations,

 

IF (truss) THEN (boiler plate notes for (truss) in .plan file, anno set roofs,

IF (rafters) THEN (boiler plate notes for (rafters) in .plan file, anno set roofs,

etc etc

 

 

but as a first step keen to read an external text file into chief user macro.

 

my aim is to significantly reduce my time per project by only having to say something once,

and replicate across several other pages in my own user defined custom boiler plate note system (based on save as method (SAM) ).

 

the underlying aim is to save typos/ ambiguities on your construction docs.

 

once the external text file is 'inside' chief into user macro's, then that is true power...

 

 

cheers,

Bernie

www.kiwicad.co.nz

Link to comment
Share on other sites

For item #1 just use the the RubY IO class -- i did a video on that about 4 years ago -- you can also load construction notes by cutting from selected parts of a word document allowing you to update your construction notes external to Chief in word doc(s) and then have them update to all your Chief plans or layouts automatically.

For the second item, Ruby can not read Text boxes in Chief, but you can paste text into a macro box and extract from there or re use that macro as many times or where ever you want.

For the third item, you can only do that by ID ing the objects,(workaround ) which is more trouble than worth right now as Chief has prevented this direct approach by way of a previous revision in labels. Also Ruby has no access to any Commands. There is no way to directly read parametric data in Ruby. Chief is not interested in providing those features so don't expect it!!

We have been asking repeatably for these features for years -- since X3-- and the response has been NOOOOOO WAYYYY!!

Link to comment
Share on other sites

See Tools > Project Information > Client Information

and Tools > Project Information > Designer Information

 

BTW, I alread have a set of files and macros for Structural, Mechanical, Electrical, Plumbing and T24 Consultants similar to what you suggest.  It's totally do-able but it would be nice if Chief would just incorporate the extras into Tools > Project Information.

Link to comment
Share on other sites

See Tools > Project Information > Client Information

and Tools > Project Information > Designer Information

 

BTW, I alread have a set of files and macros for Structural, Mechanical, Electrical, Plumbing and T24 Consultants similar to what you suggest.  It's totally do-able but it would be nice if Chief would just incorporate the extras into Tools > Project Information.

See Tools > Project Information > Client Information

and Tools > Project Information > Designer Information

 

BTW, I alread have a set of files and macros for Structural, Mechanical, Electrical, Plumbing and T24 Consultants similar to what you suggest.  It's totally do-able but it would be nice if Chief would just incorporate the extras into Tools > Project Information.

It's a no brainer. Would use this on every job. Project info should be expandable.

Link to comment
Share on other sites

We have a system that when a job comes in our Admin person puts all the information into an Excell spread sheet(name,address,zone, wind zones etc...)

I use this information in my first meeting with clients, if the client signs up the last excell sheet has a chief marco that is auto filling so we just copy and paste to a word doc and save as Json. file.

When we start our layout we just import the Json. file and it fills in all the site and client details.

 

Sounds a lot more work than it really is, it only takes above five minutes and saves about 20mins

Link to comment
Share on other sites

  • 7 months later...

Bernie,

 

This is a macro I use to set up some Ruby Global Variables by writing/reading a file

 

x = ""

$BuilderName = "Builder"

$BuilderCompany = "BUILDER COMPANY"

$BuilderStreet = "Street Address"

$BuilderCity = "City"

$BuilderState = "ST"

$BuilderZip = "99999"

$BuilderPhone = "(999) 999-9999"

$BuilderFax = "(999) 999-9999"

$BuilderEmail = "email@mailserver.com"

if File.exist?($fnbldr)

   cBuilder = File.read($fnbldr)

else

   cBuilder = "Builder

   BUILDER COMPANY

   Street Address

   City

   ST

   99999

   Ph: 999-999-9999

   Fax: 999-999-9999

   Email: builder@mailserver.com"

   File.open($fnbldr,'w'){|f|f.write(cBuilder)}

end

cBuilder = cBuilder.dump

aStrings = cBuilder.split('\n')

$BuilderName = aStrings[0].gsub('"','')

$BuilderCompany = aStrings[1].gsub('"','')

$BuilderStreet = aStrings[2].gsub('"','')

$BuilderCity = aStrings[3].gsub('"','')

$BuilderState = aStrings[4].gsub('"','')

$BuilderZip = aStrings[5].gsub('"','')

$BuilderPhone = aStrings[6].gsub('"','')

$BuilderFax = aStrings[7].gsub('"','')

$BuilderEmail = aStrings[8].gsub('"','')

x

 

Note:  $fnbldr is one of several previously established Ruby Global Variables that are the names of the files to read/write and include the full paths.  The names are derived by the following macro that needs to be executed someplace - I put in my Layout Title Block.  It's important to note that I have a separate folder & sub-folders for each project, so the file names are guaranteed to be unique.

 

x= ''

$fnsi = referenced_full_filename.gsub(".plan","")

$fnpi = $fnsi+ " Project Info.txt"

$fnst = $fnsi+ " Struct Engineer Info.txt"

$fnbldr = $fnsi+ " Builder Info.txt"

$fnsurv = $fnsi+ " Surveyor Info.txt"

$fngeol = $fnsi+ " Geologist Info.txt"

$fnT24 = $fnsi+ " T24 Consulant Info.txt"

x

Link to comment
Share on other sites

     I wish I could understand more about macros and/or using ruby. I read these ruby discussion threads from time to time and from the discussions I can see you can do a lot using macros, but I really don't have a clue to ruby or want to take what little extra time I do have to learn it (too many other projects), but someday I might have to take time. :mellow:  There seems to be a few very creative people on the forum who understand this subject very well and have put "the system" to very good use. I'm sure there are many others like me (or at least I hope) and I for one would be willing to purchase a series of these macros. Maybe they could be broke down into the areas where they are used along with training videos tied to them so if there are others like me we can all get on the "ruby band wagon"  and develope a better understanding of ruby. If this isn't possible can someone at least point me in a direction where I can learn a better understanding of ruby. (I just don't get it!) Maybe something by video. :)  I'll have check out Youtube and see what's on there.

Link to comment
Share on other sites

Larry,

 

There are some books on Ruby you can download but the language IMO is not very well documented and it takes a bit of work and practice to do some of the things I do with it. 

If you can tell me what you want a macro to do - I'll tell you if it's possible, practical and what I would charge for it.

Link to comment
Share on other sites

Larry,

 

There are some books on Ruby you can download but the language IMO is not very well documented and it takes a bit of work and practice to do some of the things I do with it. 

If you can tell me what you want a macro to do - I'll tell you if it's possible, practical and what I would charge for it.

This is part of my problem. I'm not sure what I would want to do/use because I just don't have an understanding of ruby. (the old "CATCH 22") When I read threads on the subject and someone talks about what they did with ruby I think "hey, that's neat", but up to that point I didn't even give it a thought. So refering to your question I'll have to give it more thought. To be truthful, for the time being, I would take everything that's "out there" and what works for me I would use and what doesn't I would "set aside" for the time being. It's like everything else in CA. Some things I use all the time, some things I use now and then, and some things I've never used --- yet! (and that's mainly because I don't have a full understanding of the tool) CA is a great program that most people can get up and running with quite quickly, but learning the "ends and outs" of what the program can really do in unending. At least this is my perspective.

Link to comment
Share on other sites

With Chief Architect, Ruby is currently limited (mostly) to creating textual data which can be displayed in Labels or Text Boxes.  Many Chief Objects have available attributes (data about the object) that can be retrieved within a macro and used to do calculations and return the text to be displayed.  What's possible depends mainly on what attributes are available.

 

If there's some text you want to create in Plan or Layout from the data contained in Chief (automatically vs manually entering it) it can in most cases be done using macros.  So that's your starting point in deciding what you would like a macro to do.

Link to comment
Share on other sites

I use a lot of macro's every chance I get. Text macro's are very easy to create, and we all know we hate typing the same thing over and over again. You just type or copy any text into create Ruby box. this is the simplest form of a macro.

I do have lot of others thanks to the fine people here.

 

here is a simple text macro

 

http://screencast.com/t/KV6kdcftHJ

Link to comment
Share on other sites

One thing that you will notice using Perry's "Text Macros" is that they are specific to the Current Plan.  Changing the macro on one Plan doesn't effect other Plans unless you export it and import it into the other Plan.

 

For things that should always be the same from Plan to Plan I put the macros in my Default Template.

Link to comment
Share on other sites

Joe_Carrick, on 30 Mar 2015 - 10:05 AM, said:

One thing that you will notice using Perry's "Text Macros" is that they are specific to the Current Plan. Changing the macro on one Plan doesn't effect other Plans unless you export it and import it into the other Plan.

For things that should always be the same from Plan to Plan I put the macros in my Default Template.

 

Me too. Joe. I just used a profile plan for the video but in my template plan ,I have lots

Link to comment
Share on other sites

Perry/Joe: How do you sort that large a number of macro notes so you can quickly find them? Is it easier than putting them in a user "note" library?

This sounds very similar to the callout database I am currently working with but I thought the library was the easiest method until I saw Perry's video.

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