Author Topic: Draft Then, Use history to create Script  (Read 2898 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Draft Then, Use history to create Script
« on: January 21, 2016, 03:51:22 PM »
Just another wild crazy brainstorm... Is it possible to draw something up and use mleaders, texts, dims, hatches. (Thinking like a detail). They run a routine that can take the history of what was drawn and place it in a script file? I thought I might have seen this where it placed it in a lisp file. Again just picking your brains! lol.
Civil3D 2020

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Draft Then, Use history to create Script
« Reply #1 on: January 21, 2016, 04:03:02 PM »
WBLOCK?  :-P

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Draft Then, Use history to create Script
« Reply #2 on: January 21, 2016, 04:04:35 PM »
lol. I know that. Sorry for all the scripting questions. its amazing just how simple it is.
Civil3D 2020

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Draft Then, Use history to create Script
« Reply #3 on: January 21, 2016, 04:09:47 PM »
Action Recorder is another option if it is something that WBLOCK won't handle.

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Draft Then, Use history to create Script
« Reply #4 on: January 21, 2016, 04:26:50 PM »
doesn't LOGFILEON record command line, which would take some editing.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Draft Then, Use history to create Script
« Reply #5 on: January 21, 2016, 05:05:55 PM »
I did find some more info on what you were pointing out.

http://www.ellenfinkelstein.com/acadblog/keep-track-of-what-youve-done-with-copyhist/
Civil3D 2020

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Draft Then, Use history to create Script
« Reply #6 on: January 21, 2016, 05:35:15 PM »
lol. I know that. Sorry for all the scripting questions. its amazing just how simple it is.

Though joking aside, there was some seriousness in my suggestion: if you intend to use a Script to generate geometry and other objects, then this would imply there is no user input which would imply that the geometry is either fixed or references data which a field or dynamic block could equally reference. Either way, I can't immediately think of a situation where I would opt to use a Script to generate a set of objects over simply inserting a block.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Draft Then, Use history to create Script
« Reply #7 on: January 21, 2016, 05:39:37 PM »
OK got this part figured out. Now just need to find the PickPoints of the Cursor with the Coordinates.

Code: [Select]
Select objects: Specify opposite corner: 2 found (1 duplicate), 2 total

Select objects: 
Specify base point: Int,End of
Specify scale factor or [Copy/Reference]: .25

Command:
Command: e ERASE 1 found

Command: mld MLEADER
Specify leader arrowhead location or [leader Landing first/Content first/Options] <Options>:
Specify leader landing location: *Cancel*

Command: *Cancel*

Command: sc SCALE
Select objects: 1 found

Select objects: *Cancel*

Command: _CANNOSCALE
Enter new value for CANNOSCALE <"1" = 1'">: 1" = 10'

Command: mld MLEADER
Specify leader arrowhead location or [leader Landing first/Content first/Options] <Options>:
Specify leader landing location:
Command: mi MIRROR
Select objects: Specify opposite corner: 1 found

Select objects:  Specify first point of mirror line: Int,End of
No Endpoint found for specified point.
Invalid 2D point.
Specify first point of mirror line: Specify second point of mirror line:  <Ortho on>
Erase source objects? [Yes/No] <N>: 
Command: pl PLINE
Specify start point:
Current line-width is 0.0000
Specify next point or [Arc/Halfwidth/Length/Undo/Width]:
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: *Cancel*

Command:  PLINE

Specify start point:
Current line-width is 0.0000
Specify next point or [Arc/Halfwidth/Length/Undo/Width]:
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: *Cancel*

Command:  PLINE

Specify start point:
Current line-width is 0.0000
Specify next point or [Arc/Halfwidth/Length/Undo/Width]:
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: *Cancel*

Command:  PLINE

Specify start point: *Cancel*

Command: copyhist

Command:
Command:
Command: _saveas Updating Indexes for block *Model_Space
Done.
Updating Indexes for block *Model_Space
Done.
Civil3D 2020

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Draft Then, Use history to create Script
« Reply #8 on: January 21, 2016, 05:43:38 PM »
Lee here's my thinking. And you are totally right with what you just said even with the WBlock (Insert block). Creating all this via a script on the fly is cool.
Civil3D 2020

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Draft Then, Use history to create Script
« Reply #9 on: January 21, 2016, 05:46:58 PM »
Ok I think I got it. The ActionRecorder was the way to go. It shows all the info, that I can transfer to script file. Sorry for the boneheaded question. lol. Seriously, thanks guys.
Civil3D 2020

danallen

  • Guest
Re: Draft Then, Use history to create Script
« Reply #10 on: January 21, 2016, 07:54:45 PM »

MeasureUp

  • Bull Frog
  • Posts: 462
Re: Draft Then, Use history to create Script
« Reply #11 on: January 21, 2016, 10:25:02 PM »
doesn't LOGFILEON record command line, which would take some editing.
Thanks to everyone for sharing the ideas. This topic is interesting.

Side note for "Logfileon" command:
Unlike other commands, "Logfileon" can be activated and a new log file be created automatically when switching to other drawing or opening another drawing, even if user reopens the drawing - a new log file will be created automatically.
Recording can only be terminated when AutoCAD is closed or "Logfileoff" is executed.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Draft Then, Use history to create Script
« Reply #12 on: January 22, 2016, 07:22:35 AM »
Thanks guys for everyones input on this!
Civil3D 2020