Spreadsheet based creation of scripts
in Other
In my search for a way to create a family of blocks, as a substitute for Table-driven Dyanamic Blocks, I came across this product.
It permits you to use an Excel spreadsheet to create a script and automate many things in AutoCAD. The advantage to myself is that I use the command-prompt a great deal, so it is much easier to do this than to learn all the syntax of a programming language.
It seems like it might be able to create new blocks through the following process
When a user wants a new version of a block, such as a door, they would initiate this program in the spreadsheet, which would then...
1) Open a new temporary drawing.
2) Use command-line commands to create new line art, etc.
3) Define block and select ALL objects in the drawing.
4) Copy the block to the clipboard
5) Close the temporary drawing.
6) Paste the block into the original drawing.
Though, as the user interface for CAD programs have become more dependent upon the use of the mouse, many things just can't be done from the command line, and so the usefulness of scripts is diminished. But, they seem to still be able to do the things I need for now.
The problem is that the ScriptSheets program is purely for Excel-32bit with AutoCAD, and I have neither.
Does anyone know of any programs with similar functionality that will work with Excel 64bit (or even OpenOffice), and BricsCAD?
-Joe
0
Comments
-
Joe,
I haven't tried this myself but could this technique from Jason Bourhill be of any use?
http://www.cadconcepts.co.nz/generating-a-script-using-a-spreadsheet/
David0 -
Thanks for the link to that page. I was in middle of attempting this when I ran into a limitation, when I came back to the forum to see if anyone had replied.The limitation I ran into is that the item I am attempting to create has a variable number of fans. One model may have only 1, and another may have 5. If there are more than one, I can use the MINSERT command and insert the correct number of fans, or alternative the ARRAY command. But, if there is only 1, fan, then the command line prompt does not ask for the distance.between them, and the script crashes.In the example you linked, it seems that he manually edits and creates the script, so that he can copy and paste the proper number of data points that his polyline needs. But, I suspect that he only needs to do this once per project, so it is acceptable.-Joe0
-
Scripts aren't capable of decision making, however you can make LISP calls from a script to perform this task. You can also call LISP routines and functions. I've previously used these techniques to update multiple drawings to swap an update title blocks.
Using a spreadsheet works best when you are wanting to repeat a similar task over and over on source data that varies. By building the script over columns you can quickly drag down to apply the same action to multiple rows.
An alternative to using a spreadsheet is to use a script runner. Roy offers one on his website
http://www.b-k-g.nl/bkg_batch.html
Regards,Jason Bourhill
0 -
I think I may have a solution to the issue of the quantity of fans being somtimes as low as 1, which breaks the script on my v14. But v17 uses a new version of the array command that does not change its prompts if you only select a quantity of 1.There is a new thing I noticed, that is making this a lot more difficult. If a command has a sub-menu, in V17 you MUST type only the capital letters. For example if you start the Array command, and want to change the number of rows, you must only type "R". for Columns you must only type "COL" and not the full word "Columns". Whereas in my current version 14 it is OK to type the entire word for many commands. This way, I end up with a much more readable script. Plus it can be hard to keep track if you just type the 1st letter, or multiple letters because there is another sub-command that starts with the same letter. I don't know what AutoCAD's behavior is on this issue.Anyway, I will probably now go with the spreadsheet approach. Though, I will also attempt to automate it to some extent. Perhaps in Excel, I will have a button to switch to BricsCAD and have it go through the process of creating the block by using the sequence I stated at the beginning of the thread.Thanks for all the advice.-Joe0
This discussion has been closed.