- Written by CADnoob
- Category: Tips, Tricks & Nonsense
- Hits: 651
Ok so if you follow my writing you know I put a lot of thought and work into these articles... ok well maybe... ok, ok... its more like I spilled the scrabble tiles on the floor and posted it to the internet, but hear me out. I'm writing this article because I'm in the heat of a passionate rant!
WTF are you engineering firms doing for quality control as you push out your files!!!
Recently it seems like every turnover package I get my hands on has some gross negligence in regards to quality of their files as a product. Clean up your damn files!! I have seen unused Xrefs [think some company logo that was traced and deleted but never detached], Overlapping geometry, unused templates, unused blocks, unused tabs, OTHER COMPANIES DATA! etc etc etc. These are just a few of the things I've come across.
This garbage is nothing short of digital pollution or as the kids would say #digitalpollution fam. The actual data worth keeping in the files is around 500kb yet the file is 30,000kb equates to a whopping 98% WASTE in data storage. Fucking WASTE! Worse off the files get thrown into severs and often never get touched again so its not like this waste will ever be recovered. you start multiplying these file across serves and every iteration of the file version and this efficiency in data usage can only get worse.
So how do we stop this... unfortunately the first question is weather or not the contract asks you to use the bad data drawings. If you are doing brownfield work you might be stuck using your clients old drawings. In that case, you didn't start the fire so just do what you are contracted to do and let it be. (Though I might be inclined to inform the client of the waste and let them resolve it)
If its your drawing here are some things you should try:
- Templates - If you use them (which you should) clean out any and all unused data (e.g. unused layouts and title blocks)
- XREF - If they are not needed in the final drawing... remove them! This is probably the most frequent offender. Just take a second and look in EXTERNALREFRENCES
- OVERKILL - This one is so simple it could be part of you close drawing script. If you don't do that just hit Ctrl+A and run OVERKILL every now and then.
- PURGE - This should be a no brainer!! just do it. Purge the garbage
- -PURGE R - Purge regapps. If you use verticle and other such items you often litter drawing with garbage. clean it up please.
- -EXPORTTOAUTOCAD - If the drawing is complete and design work is done you can clean a lot of stuff using export to autocad.
- AUDIT - Use Audit to clean out problem junk in the drawing. If you use non Autodesk program you definitely want to give this a run.
OK... now that I've got some of that out I think I can get back to the work of fixing this BS that got turned over to me. So in closing this is how to clean your drawing. Optimize it for long term storage and save me the twitter bitch fest. Stop #digitalpollution!!
PS as an after thought it might be nice to know what causes this type of thing. R.K. McSwain of cadpanacea.com suggested on twitter that it was likely because of one or a couple things. Ill list below so if you are playing with these types of things in your work flow, look out for me on the back end.
- Written by CADnoob
- Category: About
- Hits: 667
It's 4:30PM on a Friday and you need to print 5 drawing on the old trusty plotter. Its true she has seen better days, and given the trend that everything is moving digital, ole Bessy isn't likely ever to see relief. She is hopefully the last plotter we ever buy. At 4:31PM I initialize the publishing job. The computer signals to you that its off to the printer and the plotter makes all the old familiar warm up buzzes and whirrs. The paper shuffles into place and the ink carriage is ready to launch into action and then you hear that loud BEEP! "Shit! No! Bessy, its Friday and I've got debauchery to get to!!"
Yep, it never fails. Murphy's law is never stronger than when facing old equipment late on Fridays...
After getting slapped around a couple time by Bessy, I spoke with our plotter service tech. His suggestion was that sitting idle just might be whats causing the issues. So if you have some ageing equipment that seems to be getting cranky this may help you. Perhaps taking the ole girl for a whirl once a week will stop the fits of malfunction.
All BS aside what am I talking about: Setting up an automatic scheduled plot to keep the plotter from falling apart.
The method I'm using is partial specific to the software I have and partially not. I will be using Adobe to print and I will be using windows Task Scheduler to schedule the printing. So if you don't have adobe, the first part is not for you.
Part 1 : Getting Acrobat to print.
Unfortunately I'm not sure how long I will be able to get away with using this method as from what I have read the process which I am about to show is no longer supported. That's fancy talk for " if that shit don't work, we don't care."
What I do is I set up switches when I call adobe acrobat. This is how I get it to print. This could be done with a .bat file but plugging in my string right into the task scheduler will work for me.
What are switches? These are little things that follow the program "call." In other words when you click on an icon on your computer, you are just initializing a program. One could just as easily put "myprogram.exe" in the command window to run a program. So a switch might look like "Myprogram.exe /x" where /x executed some special feature in the program. A description of the switches or options avalible to acrobat can be found here. The general look of this is below:
AcroRd32.exe /t filepath "printername" "drivername" "portname"
Now for me I have to input the full path of everything. mine looks like this.
C:\Program Files (x86)\Adobe\Acrobat 2015\Acrobat\Acrobat.exe /t B:\Plotter Scanner\print.pdf "\\nethost\plotter" "Plotter Driver" "IP_10.10.10.10"
I tested this by throwing this 'script' in the "Run" area of the start button. It might just be listed as the search area, but it likely serves the same purpose on your machine as well. If it doesn't, type Run in the search window and then use the run window.
Some of the information for this string is a little difficult to get.
First you have to get the exact path of your Acrobat program. The path to mine is listed above.
Next in the string is just the switch "/t". This switch is a switch to print with a specific printer you want to use. This is convenient when you have multiple printers available to you.
Next in the string is the file path. This is where your PDF that you want to print lives. I personally Google searched for a color wheel so that I could have an image that would give all the color heads a good work out.
Next is the Printer name. This was a little tricky for me as my printer was on a network. I couldn't just use the printer name, I had to include the host server in the name.
Next is the driver. You can find this by going to your control panel > devices and printers then locate your plotter and right click on it and select printer properties. Then click on the advanced tab.
Next for the port info you just pop over to the ports tab and grab that info. You may have to expand the column with the port number so that you can actually see your information.
With all that info gathered you are ready to move to the next step.
Part 2: Putting it on a Timer
So this is fairly straight forward. Go to your start menu again and search Task Scheduler and click on it.
This will open the task scheduler. Yours may look a little different but the main idea is that you will create a new task. For me I just click on the Create Basic Task action. If your panes are hidden you might be able to open them by clicking on the pane button on the tool bar.
The next couple steps should be self explanatory, you name the task and set the time and frequency you want to plot.
Next you select to start a program
In the next window you dump the string we put together in part 1. NOTE: the string is a little different! You will need to add quotation marks around the Acrobat exe location.
"C:\Program Files (x86)\Adobe\Acrobat 2015\Acrobat\Acrobat.exe" /t B:\Plotter Scanner\print.pdf "\\nethost\plotter" "Plotter Driver" "IP_10.10.10.10"
It will recognize that the last part of the string is not the program and it will separate it for you and give you the message.
Tell it yes and then tell it to finish.
That's about it... unless you are like me. If you are like me, none of this worked. This is when you start screaming and pulling hair out.... hopefully not.
So if its not working for you can try running test and making changes. to do this, you can open your Task Scheduler and scrolling to the bottom to your task.
Once there you can run your script, and click properties to edit actions etc etc.
The things I stumbled on while trying to get this done was not including quotations when I needed to and not including the network path name when needed. Hopefully you can get through it with out much fuss.
So when you find yourself in your time of need you will have already have set this up and not be left in the dark by ole Bessy.
- Written by CADnoob
- Category: Tips, Tricks & Nonsense
- Hits: 2248
Ok, so here is an example where volunteering in the forums is paying dividends. I frequently visit the forums to try to help others and learn about the wonderful world of CAD. A question came through on a topic that i had never heard about (no surprise there). It was the nature of the content of the question which was amazing. They were asking about something called Core Console.
WTF is Core Console..
So I did some quick Googling and there is some info out there but not as much as I would have hoped. The following two articles are the ones I found most useful. (cadtips, Through the interface) So what is the Core Console, its basically AutoCAD stripped naked of a UI (user interface). To most, this seems like a step backwards, but to those geeks out there who like playing in a command line as much as they like playing with their selves, this is an awesome portal into nerd-dom. From what I gathered this is only 'recently' available as of 2013. So if you are rocking it old school you may have to wait until you upgrade to play with this toy.
If the potential of this still escapes you, let me put it another way. You can run scripts on drawings without ever opening AutoCAD. It allows for Batch Processing files without ever clicking on the AutoCAD icon.
mind = blown
This knowledge couldnt have come at a better time. Im staring at a heaping pile of drawings that I need to purge the regapps out of. This is all i need to do to these drawing, so once this is done i cand move them on to thier next stage in thier little DWG life. This is as clear cut an example as i could ever need to apply batch processing.
I used the previsously mentioned links as a go by. Def check them out but what i did looked like the following.
First: I created two blank txt files in the directory of the drawings I was working on.
You can open the folder in file explorer and right click on an empty space and create two new text documents. You will need to change the file extensions of these text documents to something else. If you do not know how to do this and you are looking to use core console, this is likely going to be a bumpy ride. If you cant see your file extensions you can google to find out how or follow a walk-through like this.
So If you can see the file extentiosn you need to change one of .txt to a .scr and the other .txt to a .bat. This should also change the Icon for these files.
Bat files are old school and if you are into automating things and dont know about bat files, you will want to look into them further. The .scr is a file extension for AutoCAD scripts.
Now we need to put stuff into these files. My personal favorite program for this is notepad. Its simple clean and uncomplicated. You can try right clicking and see if the edit option is available for you. You can also try the 'open with' option if that is a possibility as well and then select notepad. Or you can oipen note pad first and use its open command... just get to a place that you can edit the files.
Once inside the bat file, you will put the information which will handle the batch. The Core console its self is not a batch processor. The .bat file will be the item handling the batch aspect of the whole deal. So going by the examples in the batch file i put the following text:
|FOR %%F IN ("C:\MYDRAWINGPATH\*.dwg") DO "C:\AUTOCADCORECONSOLEPATH\accoreconsole.EXE" /i "%%F" /s "C:\AUTOCADSCRIPTPATH\SCRIPT.scr"|
Ok so a few things. You are going to need to know where your drawings are and they need to all be in the same folder. Next locate the AutoCAD core console exe file. I did this by opening windows explorer and just doing a search. You can copy the path from the explorer path bar or from property etc.
And lastly you need to know the path location of the .scr file. If you need a little more break down of these parts and pieces and what going on, go to the cad tips link above. Skip down to the lower part of the article and there is an excellent image giving the description of what each section of the bat string is up to.
Ok. So assuming all is well in the bat file arena (likely it wont be as mine sure wasnt the first time through) the next part of the puzzle is the scr file.
So the scr file is super easy (famous last words). I'm not really experienced with scr files but they look like you basically put in the commands as though you were typing them in AutoCAD. One key take away is that you have to leave a blank line to indicate the enter command. So the following example adds a line and then a circle. Notice the blank to indicate "enter"
Ok so a batch of line-circle commands aren't that useful (... or is it..) but its a good way to practice implementing some of these commands via core console. I created a practice bat file just to play. That bat file looked more like the suggestions that are provided when you start up core console. You just type in the path to core console and then the "/i" and then file the file including path and then the "/s" and then the script and location. I would recommend doing something similar to get to know the tools if you are a noob like me. It was during this playing that i stumbled on a crucial step in the process.
Your script will not run if it is not in a trusted location or if it is not a trusted file. The way you will get past this will vary on which release of AutoCAD you are using. I imagine its fairly similar between releases as you will likely go into OPTIONS and the SYSTEM and then SECURITY, but past that i don't know what has changed for each version of software. I was getting the warning of message that said: "File load canceled" and that was because i had the security settings set to display a warning message and this couldn't happen so the script would load.
Ok so on to the real work. My true goal is to purge the regapps out of several drawings so my final work horse scrip was:
; end script file
This interface doesn't show it that well but its the command "-purge" then the next line is "r" for regapps and the next line is blank for enter (thats accepting the default option of all apps in the command) then the next line is "n" for no. After that the next line is "qsave" and then the next linke is blank for enter again. The semicolon denotes a comment and is not processed.
Once thats done, just run your .bat file and it will run this script on every dwg in the directory. Now thats bad ass! All files processed in a fraction of the time with almost no effort on my part. This is a time saving way to automate AutoCAD and unleash the program with out even opening it. no go forth and core console.