Author Topic: ( C3D ) XML Reports, anybody?  (Read 9192 times)

0 Members and 1 Guest are viewing this topic.

sinc

  • Guest
( C3D ) XML Reports, anybody?
« on: February 13, 2007, 11:54:59 AM »
OK, there doesn't seem to be a way of printing a Mapcheck to the printer in C3D, the way there was in map.  I can see it on the "Analysis" tab of parcels, but there's no "Print" option.  I didn't really feel like copying-and-pasting into a generic TXT file in order to print, so I decided to check into XML reporting, and see if I could get a mapcheck that way.

And it looks like I can.  But there are issues... (surprise!)

First up, NONE of the XML reports work right with US Survey Feet.  OK, I figured out how to edit the XSL file to fix that.  I wonder once again if Autodesk will EVER understand US Survey Feet, and go on to the next issue.

The next issue is how to deal with the precision.  It almost looks like the XSL file is trying to get the precision from the LandXML dump, but the precision doesn't seem to be IN the LandXML dump.  For example, for the precision of a parcel line distance, it uses the following:

string($Parcel.Line_Segment_Length.precision)

Where is it trying to get that from?  Is it supposed to be in my LandXML somewhere, or is something else going on?  If it's supposed to be in my LandXML, how do I get it there?  I'm guessing I can just hard-code it to two decimal places, but I'm trying to understand what Autodesk did.

And how do I change the formatting of bearings?  Is there any way to force a leading 0?  Right now I'm getting stuff like this:

Code: [Select]
S 17-22-8.356 W
S 7-8-53.920 E

What I want is something like this:

Code: [Select]
S17-22-08W
S07-08-53E

Anyone dealt with THIS mess yet?  I'll keep wading through it, and post what I figure out, but I'm hoping someone else out there has dealt with this mess, and already figured some of it out.  (Probably Mr. Farrell has...   :wink:)

sinc

  • Guest
Re: ( C3D ) XML Reports, anybody?
« Reply #1 on: February 13, 2007, 12:15:22 PM »
And how do I change the formatting of bearings?  Is there any way to force a leading 0?  Right now I'm getting stuff like this:

Code: [Select]
S 17-22-8.356 W
S 7-8-53.920 E

What I want is something like this:

Code: [Select]
S17-22-08W
S07-08-53E

OK, I figured out this part.  I made some changes to General_Formating_JScript.xsl, so it is now like the attached file (file has a bogus .TXT extension added in order to post it).

sinc

  • Guest
Re: ( C3D ) XML Reports, anybody?
« Reply #2 on: February 13, 2007, 05:02:20 PM »
The next issue is how to deal with the precision.  It almost looks like the XSL file is trying to get the precision from the LandXML dump, but the precision doesn't seem to be IN the LandXML dump.  For example, for the precision of a parcel line distance, it uses the following:

string($Parcel.Line_Segment_Length.precision)

Where is it trying to get that from?  Is it supposed to be in my LandXML somewhere, or is something else going on?  If it's supposed to be in my LandXML, how do I get it there?  I'm guessing I can just hard-code it to two decimal places, but I'm trying to understand what Autodesk did.

OK, more progress to report.

First off, there's actually a little bit of help on the subject (though not much).  It's not in the Autocad or C3D help, though, but in the help for the XML Reporting 7 utility that is installed as a seperate program.

I was not able to get the structures like $Parcel.Line_Segment_Length.precision to work.  It appears that they are defined in Parcel_Layout.xsl, but I'm not entirely sure how to get them working, or why they aren't working.  Hell, I don't even know what language I'm programming in.  I think it's JavaScript, but I really don't know... :-D

Since I'm not sure which language this is or how it works, I'm not entirely sure how to fix the problem.  So for the time being, I ended up just hacking some of them.  This got things working for now, and then I can go back and figure more out later.  The precision settings seem to be the ones I'm really having problems with, so I just changed things in my main XSL file to hard-code in the precision.  I now have lines like the following:

Code: [Select]
OLD VERSION:
  <xsl:value-of select="landUtils:FormatNumber(string($LineLength), string($SourceLinearUnit), string($Parcel.Line_Segment_Length.unit), string($Parcel.Line_Segment_Length.precision), string($Parcel.Line_Segment_Length.rounding))"/>

NEW VERSION:
  <xsl:value-of select="landUtils:FormatNumber(string($LineLength), string($SourceLinearUnit), string($Parcel.Line_Segment_Length.unit), string('0.00'), string($Parcel.Line_Segment_Length.rounding))"/>

I've also discovered a lot of other issues.  I started with the MetesBounds.XSL file from Autodesk.  I already mentioned the problem I'm having with the precisions.  The curve calls did not include a call for the arc length of the curve, something that is typically required in a metes and bounds description.  In addition, the file did something truly BIZARRE with the curve deltas, returning a value that isn't even remotely correct.  It was attempting to format the Delta angle using the Distance formatting commands, and returning GARBAGE.  And from the date in the file, it's been like that since 2002...  Guess not many people are using this stuff???

I also already mentioned that the Bearings were not being formatted the way I wanted them.  Turns out the reason for this is that the formatting is hard-coded into the XSL file.  It *should* be getting this data from the Civil-3D drawing, but it doesn't.  And it also turns out that the bearing encoding routine exists in at least three different places in the XSL files.  So in order to get all my bearings to print the way I want them, I had to edit the code in a lot of places, not just in the file I mentioned in my last post.  A real fix would involve getting this information out of the Civil-3D drawing settings and styles, but that's more work than I'm interested in right now.

As usual, it was a lot more work getting this thing working than it should've been.  But now I've got C3D directly dumping metes-and-bounds descriptions of my parcels out into text that I can simply copy and paste into an MTEXT block in my drawing.  No more manual legals!  I still have to go through and add in any calls to adjacent parcels, but C3D is dumping all the bearings and distance calls into a file for me, and that's the part where the errors usually appeared.

A programming background seems to be important, but the XML Reporting seems to be truly useful.  I'm enclosing a PDF of the results I'm getting right now.

In order to create the attached PDF, all I had to do was create my parcels, then click "Execute" on my Metes and Bounds report.  That's it.  Very fast, and no third-party software.  It just took several hours of digging through ancient, buggy Autodesk code...   :laugh:
« Last Edit: February 13, 2007, 05:05:43 PM by sinc »

Cannon

  • Guest
Re: ( C3D ) XML Reports, anybody?
« Reply #3 on: February 13, 2007, 06:03:13 PM »
Sinc,
Did you try modifying the settings through the Toolbox settings editor? I'm pretty sure you can modify the accuracy there.

In either case, nice work.

JW

sinc

  • Guest
Re: ( C3D ) XML Reports, anybody?
« Reply #4 on: February 13, 2007, 08:26:23 PM »
Sinc,
Did you try modifying the settings through the Toolbox settings editor? I'm pretty sure you can modify the accuracy there.

Oy!  The plot thickens...

Have you ever edited those settings there?  In what version of C3D?

I'm on 2007 SP3, and when I open the Toolbox Settings Editor, I see only two categories - "Client" and "Owner".  I can edit all of these settings, and I figured out that the settings are being written to RepGenSettings.xml in <user docs and settings>/Local Settings/Application Data/Autodesk/LandXML Reporting.  And once the settings are saved to that file, they show up in the report.

But when I open the RepGenSettings.xml in a normal text editor, I see MORE CATEGORIES!!!  In the XML file, in addition to "Client" and "Owner", there's also "Alignment", "Profile", "Point", "Parcel", and more.  And these categories seem to include the missing settings!  So why aren't those categories showing up in the Toolbox Settings Editor?  I can see no obvious difference between the two categories that appear in the Toolbox Settings Editor, and the eight that do not.

BTW, any idea where that %ReportDir% variable is being set at?
« Last Edit: February 13, 2007, 08:28:13 PM by sinc »

sinc

  • Guest
Re: ( C3D ) XML Reports, anybody?
« Reply #5 on: February 13, 2007, 08:34:24 PM »
Another data point: all the settings show up on the "Settings" tab of the LandXML Reporting utility (the one that's installed seperately from C3D).  It is only on the "Edit Report Settings" in the C3D Toolbox that all I can see are "Owner" and "Client".

So is this a bug in C3D 2007 SP3?  Or something else?

sinc

  • Guest
Re: ( C3D ) XML Reports, anybody?
« Reply #6 on: February 14, 2007, 11:53:36 AM »
I'm discovering that once again it doesn't seem like Autodesk did this properly.

All those settings that are stored in the RepGenSettings.xml are user settings, which doesn't make any sense at all for many of them.

For example, there's a whole "Client" section, which includes name and contact information for the client.  Why is that stored in user-specific settings?  That's a drawing-specific piece of data, or at bare minimum, it's a project-specific piece of data.  Right now, if we wanted to use those settings, we would have to change the Client information every time we generated a new report.  Then if we wanted to go back and regenerate a report we did at some point in the past, we would have to key in all that information again.  It makes no sense.

The whole thing is really something of a mess.  That doesn't mean that XML reporting is any less-powerful or less-useful, just that it's harder to get it to work in a user-friendly fashion.  It's possible to rewrite the XSL files so that they do something that's more useful, but it's a lot more work than if Autodesk had set everything up correctly in the first place.

The latest issue I'm running into is that I want to get our XML Report configuration onto the network.  But this configuration is evidently saved in C:\Program Files\Autodesk Civil 3D 2007\Data\ToolBox\ToolBoxCfg.xml, and I can't figure out how to get that to point to the network.  I seem to remember C3D asking me what directory to use for the Data directory when I was installing it, and I left it at the default.  But now I think I want to change that.  How do I do it?

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: ( C3D ) XML Reports, anybody?
« Reply #7 on: February 14, 2007, 08:25:51 PM »
I'll be darned if I can find where I saw this, but I KNOW I read it recently......recent being in the past 2 months or so.

Autodesk is steering away from the use of XML reports and is encouraging VBA reports. Which probably explains the lack of documentation for the XML reports.

I will continue to look for where I saw this....maybe James or Jason know of this?

sinc

  • Guest
Re: ( C3D ) XML Reports, anybody?
« Reply #8 on: February 14, 2007, 08:44:53 PM »
Autodesk is steering away from the use of XML reports and is encouraging VBA reports. Which probably explains the lack of documentation for the XML reports.

Damn.  I really hate VBA, but it seems like Autodesk wants us to use it for everything.  Maybe I'll just have to bite the bullet and start using it.

XML Reports seem like a new thing to me, and it seems strange that they would abandon them already.  But maybe that's only because I just discovered them.  It's only in the last couple of versions that the XML Reporting installs with Autocad, and I don't even remember hearing about it when we were using LDD 2004.  It sounds like it existed before that (the XSL code is dated 2001 and 2002), but I never knew it.  And digging in the code, it seems to be largely Javascript.  It was something of a joy to use that language, after using Lisp for so many things.  I'd rather use it than VBA.  But it sounds like Autodesk has other ideas.

Now why doesn't Autodesk lose interest in pushing the Vault?    ;-)

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: ( C3D ) XML Reports, anybody?
« Reply #9 on: February 15, 2007, 11:15:57 AM »
Now why doesn't Autodesk lose interest in pushing the Vault?    ;-)

Good questions; Richard.

I think that you might be able to save the XSL style sheet with correct Client data to whatever project folder it belongs to and avoid reentering that data. And or Save the report as Project specific report name and then the end user need only select the correct named report for that project's reports.  My personal desire, would be to see Autodesk offer up a better way for the end user to configure and create custom XML style sheets for use with C3D. And let the customer choose; to use the primitive project tools as originally offered, or Vault. 


To specify report options
In Autodesk LandXML Reporting, click Tools menu  Options.
In the Report Options dialog box, enter a file name or use the Browse button to select a file to specify the location of the report forms configuration file.
The report forms configuration file stores the following:

The location of the report form (.xsl) files
The folder names as they are displayed on the Forms tab
The report form names as they are displayed on the Forms tab
At installation, the default location for the configuration file is:

C:\Program Files\Autodesk\LandXML Reporting 6\Support\RepGenConfig.xml

You can change the location of the report forms configuration file if you want to do any of the following:

Move the configuration file to a new location
Use a new configuration file
Point to a shared configuration file on the network
NoteOn the File menu, you can view the names of recently used data files. The default number of recently used files that are displayed is 4. To change the number of files that are displayed, enter a number between zero and 9.
Select the Getting Started screen check box to display the Getting Started screen when you start Autodesk LandXML Reporting, or clear the check box if you do not want to display it.
Click OK.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Cannon

  • Guest
Re: ( C3D ) XML Reports, anybody?
« Reply #10 on: February 15, 2007, 03:34:01 PM »
Now why doesn't Autodesk lose interest in pushing the Vault?    ;-)

Cause Vault kicks glazed Krispy Kremes. As of this AM, I'm running a Vault2008 Virtual Machine test box on a 2003 server with 1.5G of memory and connecting to it via wirelessly. Vault just doesn't take that much horse to get it moving. :mrgreen:

OK, so maybe kicks glazed Krispy Kremes is a bit of hyperbole. But the water's not bad once you're in.  :evil:

And yeah, I know I'm OT.

<edit> Mav
« Last Edit: February 15, 2007, 04:05:12 PM by Maverick® »

Dinosaur

  • Guest
Re: ( C3D ) XML Reports, anybody?
« Reply #11 on: February 15, 2007, 03:39:13 PM »
Cause Vault kicks glazed Krispy Kremes. As of this AM, I'm running a Vault2008 Virtual Machine test box on a 2003 server with 1.5G of memory and connecting to it via wirelessly. Vault just doesn't take that much horse to get it moving. :mrgreen:

OK, so maybe kicks ass is a bit of hyperbole. But the water's not bad once you're in.  :evil:  And yeah, I know I'm OT.
Can you say yet if Vault still requires a Windows server?
« Last Edit: February 15, 2007, 04:05:45 PM by Maverick® »

Cannon

  • Guest
Re: ( C3D ) XML Reports, anybody?
« Reply #12 on: February 15, 2007, 03:58:16 PM »
It officially requires a Windows platform. It has never required a Windows Server.

I've heard rumors of people getting it to run on Linux, but those cases are not common nor supported.

I really didn't mean to hijack Sinc's thread. If you want to go into vault, we can, but start a new one?

Dinosaur

  • Guest
Re: ( C3D ) XML Reports, anybody?
« Reply #13 on: February 15, 2007, 04:11:19 PM »
It officially requires a Windows platform. It has never required a Windows Server.

I've heard rumors of people getting it to run on Linux, but those cases are not common nor supported.

I really didn't mean to hijack Sinc's thread. If you want to go into vault, we can, but start a new one?
Thanks for the reply.  I am still a few months away from needing to start hashing over Vault so we can just let it hang there for awhile.  I was just curious if 2008 may have changed things as being compatible with a Linux server and MySQL may grease a few skids around the office.

MMccall

  • Guest
Re: ( C3D ) XML Reports, anybody?
« Reply #14 on: September 13, 2007, 10:46:14 AM »
Sinc,  Any chance you'd be willing to share those modified XSL files you used to create the report in the PDF you posted?  I'd greatly appreciate it.