PDA

View Full Version : help creating macro


TTBoy
02-04-2007, 03:57 AM
hi,

I am very new to me10 and would like some help writing a macro. I use me10 in a very different way to most users. I am a surveyor of sorts that works on a large single work site using a trimble total station to help with laying out new jobs on this yard.
I have a yard plan me10 file which I use as my top part. I open me10 drawings for jobs to fit on the yard as load file as subpart. I smash all the parts of the job into one part so i am left with my yard plan as top part and the job as a sub part. I can then move the job around the yard plan using modify move to utilize the yard space effectively for the jobs. I then save the job file as a .dwg file and load it onto the trimble setting out station to put the job in position on the yard.
Now i have given you an idea of what i use me10 for i am looking for some help creating a macro. I want to pick points on the jobs loaded onto me10 and create a points file which will be saved as a text file of co-ordinates that I can then load onto the trimble setting out station to aid me laying down the job on the yard more accuratly. Sorry for the long winded explanation but I wanted to give as much detail as possible as to how i use me10 and what i am trying to achieve.

I am really new to this so please could you keep it as simple as possible and be patient with me as any help would be very much appreciated

John Scheffel
02-05-2007, 08:45 AM
There are two main resources for learning macro programming. If you have an installation CD it should contain all the manuals including the one titled "Writing Macros with Designer Drafting". This will help you get started with basic macro syntax. Under Help in Drafting there should be a link to open the "Program Ref. Guide". This is a list of the commands available for use in macro programming. It is more of a reference but can be helpful for finding the command you need. Another good way to learn is by example. The CoCreate America's User Group Macro Site (http://www.cocreateusers.org/macros/macro.htm) contains source code that you can download and study.

To get you started, if you want to pick points and output them to a file the following commands may help. You can find details on syntax and examples in the Program Ref. Guide.

OPEN_OUTFILE - opens a file for writing
READ PNT 'Pick a point' Mypoint- Prompt user to select a point and read the XY coordinates into variable Mypoint
WRITE_FILE - used to write a line of text to the open file
CLOSE_FILE - close file. Necessary to flush buffers and complete writing of the file.

TTBoy
02-06-2007, 07:27 AM
Thanks John, still a little confused but i will have a go