Author Topic: LT Challenge . . .  (Read 19733 times)

0 Members and 1 Guest are viewing this topic.

Dinosaur

  • Guest
LT Challenge . . .
« on: March 21, 2009, 11:32:15 PM »
. . . to solve a real problem in my office.

Parameters:

The only software available is AutoCAD LT 2004
The users have zero collective experience with any CAD drafting package so a premium is placed on a user friendly solution - ideally button macros on a tool bar
A template and title blocks are in place that can accept any modifications deemed necessary.


Starting point:

The user has a completed title block (on layer "TB") on a model tab with an unlocked activated view port (on a non plotting layer) and the drawing has been saved with the desired name.

The current layer is "0" and the current style is "standard" (Arial at 0 height and .8 width factor) - mandatoty settings.

All object properties and creation modes are set to "by layer".  A dxf file with the same file name has been created by a non-Autodesk application that provides all other necessary styles and layers.  Certain text block elements will be on layer (0) when imported.

There are no and will not be any need for dimensions, dimvars or associated settings.

Task(s):

The user must now choose one of 2 possible procedures

If this is a drawing to be sent to the client:
  1. IMPORT a dxf file into the drawing (currrently by dopping the dxf icon into the view port) at 0,0 and scale factors of 1.
  2. ZOOM to extents within the view port.
     (at this point user input may be needed to correctly position the object within the viewport)
  3. EXPLODE the dxf block and PURGE the block definition.
  4. Go to PAPERSPACE and lock the viewort.
  5. SAVE the drawing (optionally in r2000 format) and exit AutoCAD.

OR

If this is a drawing needed in house for plotting but subject to update:
  The same basic procedure above except the dxf block must remain intact and open to redefinition by importing an updated dxf file using the same name.  (again, user input may be needed to correctly position the object within the viewport)

The intended in house uses for these files are strictly plotting and archiving.
« Last Edit: March 21, 2009, 11:39:25 PM by DinØsaur »

uncoolperson

  • Guest
Re: LT Challenge . . .
« Reply #1 on: March 22, 2009, 12:41:18 AM »
could this be scriptable to save having people open drawings and do stuff create a .bat file that fires off autocad and have the script files (I believe if named the same as the dwg they run when it opens) that does all this.

heck, you could set it up so the bat file takes the dwg as an arguement and creates the script file (blah.txt << %1, or something like that if I recall correctly... beer is doing its thing), then opens the dwg and does its thing. So all that is required is dragging the dwg into the bat file and wham!


if it doesn't get solved by tomorrow my mom has LT at her house, and I'm going out that way... I'll give it a few tries.
« Last Edit: March 22, 2009, 12:46:47 AM by uncoolperson »

Dinosaur

  • Guest
Re: LT Challenge . . .
« Reply #2 on: March 22, 2009, 01:44:19 AM »
I could be ANYthing OOTB LT is capable of doing that can be accomplished with as little user input as possible - over half of this bunch has no CAD experience (AutoCAD or otherwise).  One guy has a bit of recent experience and there is one who worked with Microstation several years ago.  The rest have only exported the program plot output into clipboard and pasted it into a blank dwg for archive.

Our plots are currently done through a windows form process that is having severe permissions problems as we have grown and the ability to plot via AutoCAD files would be a tremendous benefit.  SKM plot output is distorted by not only odd, but also different and unpredictable scale factors and the forms are never correctly proportioned or positioned for plotting after the pasting process into AutoCAD.

Shinyhead

  • Guest
Re: LT Challenge . . .
« Reply #3 on: March 22, 2009, 08:36:46 AM »




Quote
If this is a drawing to be sent to the client:
  1. IMPORT a dxf file into the drawing (currrently by dopping the dxf icon into the view port) at 0,0 and scale factors of 1.
  2. ZOOM to extents within the view port.
     (at this point user input may be needed to correctly position the object within the viewport)
  3. EXPLODE the dxf block and PURGE the block definition.
  4. Go to PAPERSPACE and lock the viewort.
  5. SAVE the drawing (optionally in r2000 format) and exit AutoCAD.


OK, doing this at home without a copy of LT, so this will require debugging of course as I am trying to pull the correct command syntax from memory, including the number of prompts you have to hit.
Firt thing is to find something that will copy your dxf to your clipboard outside of LT.  Once that is done then its not too hard.

C^C^_pasteclip;0,0,0;1;;;0;z;e;xplode;l;-pu;all;ps;-vports;l;a;;qsave;


For the other version, I have to look at that at work and play a bit to see what I can come up with. 

uncoolperson

  • Guest
Re: LT Challenge . . .
« Reply #4 on: March 22, 2009, 09:31:47 PM »
didn't hit LT today, I'll try with full autocad at work tomorrow

Shinyhead

  • Guest
Re: LT Challenge . . .
« Reply #5 on: March 23, 2009, 08:45:22 AM »
OK,
Played with it and I think this will work for you.
It inserts whatever is on the clipboard at 0,0.
Explodes it
purges all unreferenced blocks(no way to get only the single block definition as far as I know)
Zooms to extents
prompts to pan for adjustment of view (I am not fond of this part of the routine)
switches to paperspace
locks the viewport
turns off file dialog box
saves as 2000 format with current name
turns on file dialog boxes again.

here is the macro code
C^C^_pasteclip;0,0;^Cexplode;l;-pu;b;;n;zoom;e;pan;\\ps;-vports;l;ON;all;;filedia;0;saveas;2000;;y;filedia;1;

I will play with the second macro next

Shinyhead

  • Guest
Re: LT Challenge . . .
« Reply #6 on: March 23, 2009, 08:48:40 AM »
Here is the second routine
It works the same way without the explode or the purge.

If you need to update the block, just use design center to redefine it if needed.

C^C^_pasteclip;0,0;^Czoom;e;pan;\\ps;-vports;l;ON;all;;filedia;0;saveas;2000;;y;filedia;1;

uncoolperson

  • Guest
Re: LT Challenge . . .
« Reply #7 on: March 23, 2009, 11:00:46 AM »
take the macro code and make it a script

make this .bat file
Code: [Select]
"C:\Program Files\Autodesk\Acade 2005\acad.exe" %1 /b thescript.scrput both somewhere everything will be found (the dwg directory is good)

then the user can drag the dwg file into the bat file and it should open the drawing run your script (maybe add a quit to it), and no one needs to know what they are doing.

Dinosaur

  • Guest
Re: LT Challenge . . .
« Reply #8 on: March 23, 2009, 01:39:41 PM »
It appears the first problem I need solved is how to get the DXF information into the clipboard.  I have   an option to export the file to clipboard but this brings in some kind of image that defies all means to select or manipulate except erase for a new start and that is even quite difficult.  Even worse, the reason for the task is to get the contents translated into ACAD objects for the client.

Chris - I made a new toolbar with a button for each of your macros.  The contents come in as the above image  that defies any selection method to allow the macro to continue although looking at the command line I see "0,0 is not a valid command" so it is breaking very early on.

Andy - apart from the same clipboard issue, your bat file and script idea seems to work ... I think.  I used the macros Chris posted to populate the script.  The script continues to end needing only a hit on the enter key to get a command prompt.  Unfortunately something in the process flushes the clipboard too early and I still just have an empty title block.

M-dub

  • Guest
Re: LT Challenge . . .
« Reply #9 on: March 23, 2009, 01:47:55 PM »
It appears the first problem I need solved is how to get the DXF information into the clipboard.

If you need to get it from AutoCAD to the clipboard, why not

^C^Ccopybase;\


Scratch that...
« Last Edit: March 23, 2009, 01:51:41 PM by M-dub »

Dinosaur

  • Guest
Re: LT Challenge . . .
« Reply #10 on: March 23, 2009, 01:58:52 PM »
If you need to get it from AutoCAD to the clipboard, why not

^C^Ccopybase;\
I am not starting in AutoCAD . . . I am translating from SKM preferably via DXF into LT.  The only output via clipboard so far is either the static image I described or VERY rough low resolution primitives.  The DXF I can drag in gives me linework, blocks and the captions are turned into text objects all on layers created with the DXF.

Shinyhead

  • Guest
Re: LT Challenge . . .
« Reply #11 on: March 23, 2009, 02:03:08 PM »
Add a zero, it maybe looking for all three coordinates
so its 0;0;0; instead of 0;0;

mine takes it fine, but maybe thats what is choking it.

Shinyhead

  • Guest
Re: LT Challenge . . .
« Reply #12 on: March 23, 2009, 02:03:58 PM »
I wouldn't be able to get to it today, but could you email me one of these dxfs to play with?  Maybe I can see what its doing.

Bob Wahr

  • Guest
Re: LT Challenge . . .
« Reply #13 on: March 23, 2009, 02:11:53 PM »
why are we pasting in the dxf instead of inserting it?

Shinyhead

  • Guest
Re: LT Challenge . . .
« Reply #14 on: March 23, 2009, 02:14:30 PM »
that is an option, the challange is to automate it somewhat in LT.  The limits of when a macro breaks makes it challanging.