Jump to content

Data Extraction Rounding Issue


MechanicalAnimal

Recommended Posts

Hi All,

 

Not sure if my previous post posted or not so I apologize if this is a repeat.

 

I am trying to use data extraction to measure the lengths of a series of polylines and compose a table including their layer name, length and quantity. The kicker is I would like all of the rebar lengths to be rounded to the nearest inch.

 

I have been about 80% successful in doing this however whenever the data extraction rounds the polyline lengths it still wants to place them in different rows within my charts.

 

(Ex. Polyline 1 = 10.27", Polyline 2 = 10.39")

 

 

Should return chart saying QTY=2, "layer name", 10"

 

 

What happens is two separate lines, each having the proper layer name and 10" but they each have QTY=1. Basically it is not combining the "like terms".

 

That being said I have checked the "combine like items" checkbox in the data extraction window and this still occurs.

 

I believe where the error is occurring is that it is Rounding the output into the table but still recognizing these to be two different length "in the background" of CAD.

 

Any help would be greatly appreciated!

Link to comment
Share on other sites

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

  • Dadgad

    10

  • MechanicalAnimal

    8

  • eldon

    7

  • Cad64

    5

Top Posters In This Topic

Posted Images

Not sure if my previous post posted or not so I apologize if this is a repeat.

 

Your post got caught up in the moderation queue for some reason. I have approved it, so hopefully someone will be along shortly with some advice.

 

Welcome to the forum. :)

Link to comment
Share on other sites

Welcome to CADTutor. :)

 

There was a similar thread a few months ago, but without this rounding issue.

Are you able to post a .dwg? Create a copy and remove anything proprietary.

Just a small part of your drawing would suffice.

Link to comment
Share on other sites

I located that previous post of which I spoke

http://www.cadtutor.net/forum/showthread.php?91345-Pline-lengths-organized-in-a-table&highlight=dat+extraction

I downloaded that drawing I had posted and played around with the date extraction table in it, and was unable to get it to behave like you want.

Getting it to display as whole numbers is not a problem, but recognizing and grouping lengths by that ROUNDED length seems to me to be undoable, with the OOTB functionality.

I really like using Data Extraction, and as BIGAL suggests in that thread, maybe sending the data out to excel before using a data link back into the .dwg is an option.

I have never needed to go that route.

Sorry I couldn't help you more. Good luck with it. :)

 

I just took a look on Lee Mac's site, thought he might have something for you, but I didn't see anything I thought would be able to do that.

Plenty of other great stuff though! Thanks Lee! :beer:

Edited by Dadgad
Link to comment
Share on other sites

Thanks for the warm welcomes everyone!

 

 

Dadgad - I actually have a program that I wrote in excel that did this pretty well for CAD LT for the company I work for.

 

However to cut down on time and minimize error we purchased the full versions thinking we would be able to keep everything within the four walls of CAD.

 

 

It seems to be a pretty big issue that people are having as I have browsed the web for this and have seen many other postings on different forums about this but nobody was able to offer any help.

 

 

Is there a chance that writing a Autolisp might but able to overcome this issue?

 

 

Any other ideas would be greatly appreciated as well!

Link to comment
Share on other sites

Well the issue isn't with excel, its within CAD.

I am trying to use Data Extraction to create a table of the lengths of a series of polylines. I want to keep all of the work within CAD.

This part I have no problem doing, however I want the outputs of these polylines to be rounded to the nearest WHOLE number. This too is easily done.

The problem is that the rounded numbers are not placed into the SAME row.

 

 

Imagine I have two bars - BAR A and BAR B.

 

 

BAR A = 10.25" and BAR B = 10.42"

 

 

The table should return QTY. = 2 LENGTH = 10" however what it returns are 2 SEPARATE lines of QTY. = 1 LENGTH = 10"

 

 

My company recently updated from CAD LT to the full 2015 Mechanical version primarily to do this exact thing so I am kind of hoping this is something that CAN be accomplished.

 

If not, are there any Lisp programs that you may know of to tackle the same issue?

Link to comment
Share on other sites

Well the issue isn't with excel, its within CAD.

I am trying to use Data Extraction to create a table of the lengths of a series of polylines. I want to keep all of the work within CAD.

This part I have no problem doing, however I want the outputs of these polylines to be rounded to the nearest WHOLE number. This too is easily done.

The problem is that the rounded numbers are not placed into the SAME row.

 

 

Imagine I have two bars - BAR A and BAR B.

 

 

BAR A = 10.25" and BAR B = 10.42"

 

 

The table should return QTY. = 2 LENGTH = 10" however what it returns are 2 SEPARATE lines of QTY. = 1 LENGTH = 10"

 

 

My company recently updated from CAD LT to the full 2015 Mechanical version primarily to do this exact thing so I am kind of hoping this is something that CAN be accomplished.

 

If not, are there any Lisp programs that you may know of to tackle the same issue?

 

I already mentioned that most of the Excel commands will work in AutoCAD tables (also Field Formulae, etc.).

 

Did you try the Excel functions in the AutoCAD table?

 

Is it an actual AutoCAD Table or is this something specific to Mechanical.

 

It might help to simply post a drawing.

Link to comment
Share on other sites

I am not sure any formula within the table will work as CAD is already "rounding down" on its own, its just that once it has rounded them it is still internally recognizing them as two separate lengths.

 

Attached is a very basic file that should convey my point a little more clearly.

 

 

When you open this file there will be 8 polylines. If you do a length command you will see that the they measure two different lengths 15.4302 and 15.2902.

 

 

The table at the bottom was made using a data extraction.

 

This is the layout that I am looking for, however when I check the box within the data extraction to combine like rows, it will combine the 15.4302 lengths into 1 row and then combine the 15.2902 lengths into another row. It will then round them to the nearest whole inch (15) but keep them in the 2 separate lines within the table.

 

 

Please let me know if you have any questions on what I am trying to attain.

 

 

I apologize for how basic this file is but it seemed it was the quickest way to get the point across.

 

 

I appreciate any help offered!

TABLE EXAMPLE.dwg

Link to comment
Share on other sites

Not sure why, but your posts keep getting caught in the moderation queue. This is the 3rd one I've had to approve. :?

 

 

 

Am I doing something wrong?

Link to comment
Share on other sites

The problem is more of a SORTING problem than a precision issue.

Data extraction accesses the raw data for sorting by default, so that is the behavior which needs to be rectified.

I imagine everybody understands that, just thought it worth summarizing. :|

 

Your table example perfectly demonstrates the issue, without muddying the waters. :)

 

Having explored the REFINE data option, for the Data Extraction function,

I see no OOTB way of forcing the SORT function to recognize the rounded values.

It sorts by DATA, not by DATA DISPLAY.

Edited by Dadgad
Link to comment
Share on other sites

Am I doing something wrong?

 

And post number 4 has just been approved. :lol:

 

I can't see anything wrong with your posts, especially this last one. There was absolutely no reason for that one to get moderated, but it was. Weird. :?

Link to comment
Share on other sites

 

Dadgad - I actually have a program that I wrote in excel that did this pretty well for CAD LT for the company I work for.

Is there a chance that writing a Autolisp might but able to overcome this issue?

Any other ideas would be greatly appreciated as well!

 

I should think (highly speculative from an il-lisperate) that it probably could.

As frustrating as it is, does the excel program you wrote work with your new Autocad Mechanical?

I am pretty sure you won't be able to do it within the data extraction function, unless you opt for a DATA LINK from excel, as described in the screenshot.

external dat link.jpg

Link to comment
Share on other sites

Not having the Data Extraction facility, my comments are purely theoretical.

 

In a spreadsheet or table, the data always has its full value, regardless of the visible precision. Unless you operate on that data with a formula, you will never get the result that you are looking for.

 

Have you inserted a Formula column and what formula have you used in that formula column?

Link to comment
Share on other sites

Not having the Data Extraction facility, my comments are purely theoretical.

In a spreadsheet or table, the data always has its full value, regardless of the visible precision. Unless you operate on that data with a formula, you will never get the result that you are looking for.

Have you inserted a Formula column and what formula have you used in that formula column?

 

I couldn't figure out how to write a formula which would change (as opposed to display) it to the nearest whole number, figured that might be handled in excel, and that column brought back into the data extraction table with External Data Link, as described in the last screenshot.

Link to comment
Share on other sites

The excel formula could be (all to zero places of decimals):-

 

=ROUND(data,0) which would round it to nearest whole number

 

=TRUNC(data,0) which would truncate the fractional part

 

=ROUNDDOWN(data,0) which would round downwards

 

=ROUNDUP(data,0) which would round up

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...