Author Topic: Custom XML Reports  (Read 4155 times)

0 Members and 1 Guest are viewing this topic.

crwnrylcad

  • Guest
Custom XML Reports
« on: September 02, 2007, 04:24:34 PM »
Go ahead and yell at me all you want here, but where in the world can I find some really good tutorials that are C3D 2008 compatible for creating either 100% custom XML reports or at least being able to add items to the pre-made reports? I am horrible as far as XML goes right now, but I want to change that and find books and sites that I can use as a good reference. One form I am looking into customizing is the Parcel Areas on so it can show minimum/maximum/average lot area and perimeters. Anyone have any suggestions or recommendations besides W3C and those other sites that do not specifically pertain to C3D? Oh, and btw, what is up with LandXML.org????? Why don't they have online discussions showing users what can be done to larger extents with xml and xsl integration into C3D?? Grrr....sorry, that last bit was more of a rant than anything.

Thx

sinc

  • Guest
Re: Custom XML Reports
« Reply #1 on: September 04, 2007, 05:01:15 PM »
As far as I know, the XSL reports are being deprecated.  If you look at the dates in the source code, you'll see that for the most part, they were written in the 2001-2002 timeframe, and except for a revision in 2005, they mostly haven't changed.

I've heard word from Autodesk that they are "looking at some different ways of doing reports", but I have no idea what those will be, or when they will be available.

In the meantime, I actually do not know of any tutorials.  That doesn't mean there aren't any, just that I haven't seen any.  I actually dug through them and did some of my own customizations and fixes.  It isn't particularly hard, but it can be tricky figuring out how all that stuff fits together.  The code is rather poorly-written - for example, I believe the code for formatting a bearing is duplicated in three different places, so if you want to do something like change bearings to look like N35°26'36"E instead of N 35-26-36 E, you'll probably need to locate all three places in the code, and change them all.  There are some other issues, too, like the existing code doesn't work if you use US Survey Feet as your units, but the issues are generally relatively easy to fix if you can find the right place in the source code.

One thing that still kind of bugs me is I still haven't figured out any way of suppressing the extra space before semicolons.  For example, in the Metes and Bounds report, each course ends in a semi-colon, but there is always an extraneous space added after the last word in the sentence and before the semi-colon.  This is basically a side-effect of the way the XSL generates HTML, and I haven't yet found a way to get around it.

You can also check into VBA reports, instead of the XSL stuff.

crwnrylcad

  • Guest
Re: Custom XML Reports
« Reply #2 on: September 06, 2007, 11:36:32 PM »
Does anyone know the correct usage of sum() with xsl and variables??? I am trying to find the correct way to pull all of the @area's and add them up into one total sum. Has anyone had luck with this?

crwnrylcad

  • Guest
Re: Custom XML Reports
« Reply #3 on: September 10, 2007, 07:12:17 PM »
or those of you who might be wondering, i was actually able to get an overall sum of all of my parcel areas without having to go through and do a for statement. below is what I have done, and seems to work 100% fine for me...you will need to make adjustments for items such as formatting, but besides that it should be good to go.

Code: [Select]
<td>
<strong>Total Parcel Area:</strong>
<xsl:value-of select="sum(//lx:Parcels/*/@area)"/>
</td>

crwnrylcad

  • Guest
Re: Custom XML Reports
« Reply #4 on: September 12, 2007, 01:20:05 PM »
I am sure that there may be a few of you that may be interested in the following code:

Code: [Select]
<br />
<center>
  <span style="font-style:italic">Please note that all information provided below is formatted<br />
  to show the same units of measurement as shown above.</span>
</center>
<br />
<table bordercolor="black" border="1" cellspacing="0" cellpadding="4" width="95%" align="center"><caption><strong>Extended Parcel Data</strong></caption>
<tr>
<td style="border-bottom:none;" align="left"><strong>Total Parcel Count:<xsl:text> </xsl:text></strong> <xsl:value-of select="count(//lx:Parcel)"/></td>
</tr>
<xsl:variable name="ParcelSums" select="sum(//lx:Parcels/*/@area)"/>
<xsl:variable name="ParcelSumFix" select="landUtils:FormatNumber(string($ParcelSums), string($SourceAreaUnit), string($SourceAreaUnit), string($Parcel.2D_Area.precision), string($Parcel.2D_Area.rounding))"/>
<tr>
<td style="border-bottom:none; border-top:none;" align="left"><strong>Total Parcel(s) Area:<xsl:text> </xsl:text></strong>
<xsl:value-of select="$ParcelSumFix"/>
</td>
</tr>
<xsl:variable name="ParcelCnts" select="count(//lx:Parcel)"/>
<tr>
<td style="border-bottom:none; border-top:none;" align="left"><strong>Average Parcel Area:<xsl:text> </xsl:text></strong>
<xsl:value-of select="($ParcelSumFix div $ParcelCnts)"/>
</td>
</tr>
<tr>
<td style="border-bottom:none; border-top:none;" align="left"><strong>Maximum Parcel Area:<xsl:text> </xsl:text></strong>
<xsl:for-each select="//lx:Parcels/*">
        <xsl:sort select="@area" data-type="number" order="descending"/>
<xsl:variable name="ParcelMaxArea" select="position()"/>
<xsl:choose>
<xsl:when test="$ParcelMaxArea = 1">
<xsl:value-of select="@area"/><xsl:text> ( </xsl:text><xsl:value-of select="@name"/><xsl:text> )</xsl:text>
</xsl:when>
</xsl:choose>
        </xsl:for-each>
</td>
</tr>
<tr>
<td style="border-bottom:none; border-top:none;" align="left"><strong>Minimum Parcel Area:<xsl:text> </xsl:text></strong>
<xsl:for-each select="//lx:Parcels/*">
        <xsl:sort select="@area" data-type="number" order="ascending"/>
<xsl:variable name="ParcelMinArea" select="position()"/>
<xsl:choose>
<xsl:when test="$ParcelMinArea = 2">
<xsl:value-of select="@area"/><xsl:text> ( </xsl:text><xsl:value-of select="@name"/><xsl:text> )</xsl:text>
</xsl:when>
</xsl:choose>
        </xsl:for-each>
</td>
</tr>
</table>

The above code for Parcel Reports is what I have come across to properly obtain the follow items: Total Parcel Count, Minimum (Smallest) Lot, Maximum (Largest) Lot, Average Parcel Size & Total area of all parcels. If anyone has any questions or comments, please feel free to ask. I will be posting other forms that I create, while also trying to explain them as I go. Hope this helps someone.

Dinosaur

  • Guest
Re: Custom XML Reports
« Reply #5 on: September 12, 2007, 01:36:36 PM »
Thanks, I appreciate the contribution.  Reports of all kinds seem to be a major shortcoming of Civil 3d and there are very few around that seem inclined to share their discoveries.

crwnrylcad

  • Guest
Re: Custom XML Reports
« Reply #6 on: September 12, 2007, 01:44:50 PM »
No problem Dino...I hope this really helps people. I will make this note about the above code, some of the decimal formatting does not follow through 100% as of this very moment, but I am working on that as we speak.

***The above code is what I have placed below the current parcel area table that comes standard with landxml 7***
« Last Edit: September 12, 2007, 01:45:56 PM by crwnrylcad »

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Custom XML Reports
« Reply #7 on: September 12, 2007, 01:51:09 PM »
Thanks, I appreciate the contribution.

Same here! Thanks for sharing.
TheSwamp.org  (serving the CAD community since 2003)

sinc

  • Guest
Re: Custom XML Reports
« Reply #8 on: September 12, 2007, 03:50:41 PM »
There's a few weird occurrences with reports.

One of them occurs when attempting to run something like a metes and bounds report on a single lot in a site.  Every point of intersection - i.e., the equivalent of every "node" in a Map polygon topology - creates a new segment around the site.  Assume the rear of Lot 5 is N90°E a distance of 100 feet.  However, assume 20 feet of the back of the lot abuts Lot 8, while the rest abuts Lot 9.  Your metes and bounds report for Lot 5 will not have a single course of "N90°00'00"E 100.00 feet".  Instead, it will have two courses for the back of the lot, a "N90°00'00"E 20.00 feet" course followed by a  "N90°00'00"E 80.00 feet" course.

There is another weird issue that occurs when creating parcels from existing linework, including when using the "XREF" option for creating parcels.  Any closed area will be broken into a number of parcels internally, which get "unioned" together behind-the-scenes.  For example, say you have a block in the center of your subdivison that is completely enclosed by ROW.  When you create your parcels, the ROW may look like it is all one giant parcel, for example, it might look like it's Parcel 50.  But when you run the report, you will discover that internally, it is really a bunch of unioned parcels called "Parcel 50_1", "Parcel 50_2", etc.

crwnrylcad

  • Guest
Re: Custom XML Reports
« Reply #9 on: September 12, 2007, 05:45:48 PM »
I see what you are talking about sinc...and i think i know of a way to work around it...give me a little while and i will see what i can do...

Dinosaur

  • Guest
Re: Custom XML Reports
« Reply #10 on: September 12, 2007, 06:10:39 PM »
Sinc, what you are seeing has nothing really to do with parcels at all.  Civil 3D general labels will do the same thing on bpolys that are abutting each other but return the expected results if there are no abutting bpolys.  Also of note, if you create a bpoly along existing adjacent bpolys, a PI is created at that intersection.  I appears to me that this is a function of the AutoCAD bpoly command rather than something created by Civil 3D.

sinc

  • Guest
Re: Custom XML Reports
« Reply #11 on: September 13, 2007, 10:37:21 AM »
When you say BPOLY, what exactly are you referring to?  I only know BPOLY as a command that was discontinued in 2004, and replaced with the BOUNDARY command.

Are you talking about Map polygon topologies?

Dinosaur

  • Guest
Re: Custom XML Reports
« Reply #12 on: September 13, 2007, 11:00:39 AM »
Discontinued perhaps, but still a valid command that behaves as I described as does apparently the boundary command.  I use bpoly out of habit, but either gives me the same results with the extra unneeded PI.

sinc

  • Guest
Re: Custom XML Reports
« Reply #13 on: September 13, 2007, 11:34:32 AM »
Well, the problem is similar, if not exactly the same thing.

BOUNDARY simply creates polylines, and the labels go from vertex to vertex of the polylines.

With the Parcel loops, the question gets a bit dicey.  Most of the time, we would want those courses combined into a single course.  Of course, there are times when we actually *do* need both courses, for example, a legal that follows the boundary of one existing subdivision for the first part, then the boundary of a second subdivision for the second part.  Even though both courses may be along the same bearing, we would call them out as two courses anyway, because the controlling factor would be that they follow the boundary of the existing subdivisions, not the bearings and distances called out in the description.

So really, the report needs to be interactive to some extent.  It should examine each course to see if it is a continuation of the previous course, and if so, it should ask the user if the courses should be merged or not.  Ideally, this could be done in some graphical or tabular fashion for the entire parcel all at once, and not in response to a whole series of prompts.

crwnrylcad

  • Guest
Re: Custom XML Reports
« Reply #14 on: September 22, 2007, 05:11:12 PM »
Hey guys, I wanted to find a way to give some 'tutorials' on things as i deal with c3d 08 and other items. And the first tutorial happens to be the extended parcel data report as i created here. I am trying to work on two other reports to add soon...one will be a surface volumes extraction report and then a metes and bounds report that 'joins' lines and hopefully arcs that have the exact same bearing, etc.. I am also in the process of a few style examples.

Please stop by and see if it helps :D

http://engineeringnv.wordpress.com