Jump to content

Export Co-ordinates Macro


CJEngineering

Recommended Posts

Hi,

 

I'm new here and I'm looking to make a macro that will allow me to export co-ordinates from autocad into an excel sheet similarly to Click 2 XLS but make it leave a mark and number as reference to the where I have clicked.

 

Is this sort of thing even possible? If so where would you suggest that I start with finding a way to do this?

 

 

Link to comment
Share on other sites

Export everything (every line, ...) ?  just blocks (if yes, read attributes ? ) ? ...

 

can you give a small example of end result that you want, both the excel & dwg ?

That mark, is that a block with an attribute?  or a point with text next to it ... ?

Link to comment
Share on other sites

I've attached a PDF of an Autocad drawing showing the result that I'm looking for and a CSV file looking roughly like I want.

 

What I've been doing to get the results without the macro is exporting Co-ordinates from autocad into excel using Click 2 XLS (link https://www.cadforum.cz/cadforum_en/click2xls-click-points-to-export-from-autocad-to-excel-tip8030) then putting the CSV file into my Leica controller and exporting it as DXF which is giving me point references etc.

Macroexample.pdf 15.04HOOK3.csv

Link to comment
Share on other sites

What you want is set out point routine, bottom line is have a block with a single attribute, the point number, I have a couple. Pretty sure a better answer is on lee-Mac  website he has a point number routine that renumbers when you remove a point.

 

The routine I have checks for last point number so don’t have to do all in one go. You create points as one routine, then another makes the xyz file. It also has a point labeller drag the bubble.

 

Its like 20 years old so in looking at PDF maybe should be made smarter by not only picking points but recognise objects like lines and plines. This does though have the overhead of checking for a point already on end. 

 

On IPad now will try to post something later.

Link to comment
Share on other sites

These are very old but work. Use setoupt to insert points, use setout last ptno to find last point number, use setout file to create a csv file. The dwg has the two blocks you need. It is metric so happy to tweak to work with feet just need sample dwg to sort it out.

 

It is on my wish list to make way better.

 

Press enter to repeat and enter to accept next number. Will change to a while as soon as I can. There is also make a table of the csv file.

 

If you post a dwg may be able to improve to pick object rather than point. just cut it down a bit and save with only the layers you want setout for and some other layers need to be able to turn on/off other layers to see any problems.

 

 

 

SETOUT - File.LSP Setout Last Ptno.LSP new block.dwg

SETOUTPT-2019.lsp Multi GETVALS.lsp

Edited by BIGAL
Link to comment
Share on other sites

Thanks Bigal, I'm fairly basic when it comes to autocad as I only use it to set out eg Point ID and Measuregeom. 

 

How do i use these with Autocad? and have you got a screen shot of the outcome?

 

Thanks in advance.

Link to comment
Share on other sites

I have modified setout-2019 which checks a few more things. Also added multi getvals.lsp which is needed 

 

To run save all the files into a directory that is in your search path. Setout-2019.lsp You can drag and drop from explorer or use appload to load it. To repeat just type setoutpt. This is step one. it should mke points with numbers.

 

The run setout - file to make the csv file.

 

You need to open Newblock and copy the two blocks to your drawing template then delete, the block definition they will still be there. Future version will make the two blocks if it does not exist. Just ask questions if stuck.

 

image.png.8599221e1c9bf65bc14acbd74e5607c5.png

 

 

 

Edited by BIGAL
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...