Ruby - Hash table question


SWBDesign
 Share

Recommended Posts

I would like to create a database module for keynotes to be used in Chief Architect.

The idea is to create notes in the database, export a .csv file to a location in the project folder and have a macro in Chief that reads the .csv file and uses it as a hash table.

 

Then, once in Chief Architect, embed the macro into a note object and have one of the Object Information fields provide the key value to allow for the hash table search.

 

So my questions are:

 

1:           Are there any fundamental coding issues with what I’m proposing?

 

2:           Can I output a Hash Table with more than one column of data for each key value?

Is it feasible to create a macro that will return the value of a specific column?

 

Exported file format

Pk          Short Note        Long Note

1             Value 1-1           Value 1- 2

2             Value 2-1           Value 2-2

3             Value 3-1           Value 3-2

4             Value 4-1           Value 4-2

5             Value 5-1           Value 5-2

6             Value 6-1           Value 6-2

Link to comment
Share on other sites

you could also...if your db is not being used for any other purpose other than CA notes, put each note in a CA text macro in your template plan, and then just call whichever macro from your notes.

 

...or put them in a ruby module which loads..and call whichever.

 

but probably only an option if you do not use the db for any other purpose

Link to comment
Share on other sites

3 hours ago, SHCanada2 said:

you could also...if your db is not being used for any other purpose other than CA notes, put each note in a CA text macro in your template plan, and then just call whichever macro from your notes.

 

...or put them in a ruby module which loads..and call whichever.

 

but probably only an option if you do not use the db for any other purpose

Notes inside of macro's what I currently do, it works well for consistency across the plan set.

The issue with doing it this way is I end up with hundreds of macros cluttering up the macro library.

The database option will provide additional utility as I'll likely design the note record to storage related technical documentation which can be exported into a project folder to allow for easier collation for submission to the local authority.

Also the db does quite a lot of other project specific things as well, so I'll be able to port other information over into Chief via notes as well if I need to.

 

But I do have to build the thing first, from past experience db creation seems to take me at least 2-3x as long as I think it will when I start working on it.

Link to comment
Share on other sites

1 hour ago, SWBDesign said:

Notes inside of macro's what I currently do, it works well for consistency across the plan set.

The issue with doing it this way is I end up with hundreds of macros cluttering up the macro library.

The database option will provide additional utility as I'll likely design the note record to storage related technical documentation which can be exported into a project folder to allow for easier collation for submission to the local authority.

Also the db does quite a lot of other project specific things as well, so I'll be able to port other information over into Chief via notes as well if I need to.

 

But I do have to build the thing first, from past experience db creation seems to take me at least 2-3x as long as I think it will when I start working on it.

instead of a bunch of macros, use a bunch of notes in a cad detail and then create a schedule where the schedule number designates the note that will be used:
 

Link to comment
Share on other sites

2 hours ago, SHCanada2 said:

@Renerabbitt interesting, that looks like it might be persistent. Or does one have to click on the CAD detail to fire the macros, and if 2 plan files are open does it still work ( the whole global variables problem)

Ive never been bothered by the two plan files open because I never print when two plan files are open. I just shut down chief, open and print. You dont need to click on the cad detail
 

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