AutoCAD Civil 3D General Discussion

AutoCAD Civil 3D General Discussion

Reply
Active Contributor
lsssurvey
Posts: 38
Registered: ‎06-27-2008
Message 1 of 24 (1,055 Views)

XML Parcel Legal Description Errors

1055 Views, 23 Replies
10-12-2010 04:45 PM

I saw a post similar to this back in May, but no real help solving it.

 

While generating a General Legal Description for Parcels xml report for a parcel with numerous tangent curves, reverse curves and compound curves, the report labels all of them as non-tangent.

 

Also, I write my legal descriptions for curves by citing the bearing and distance OUT to the radius from the beginning of the curve, but the routine gives me the bearing and distance IN from the radius. It is using the code {curveStartDirection}.

Is there a different code I can use that would give me the opposite bearing? Is there some resource that lists all these codes for parcels?

 

Tom Rope

Valued Contributor
rick.hberg
Posts: 75
Registered: ‎06-27-2011
Message 2 of 24 (826 Views)

Re: XML Parcel Legal Description Errors

03-12-2012 03:59 PM in reply to: lsssurvey

I know it's super late from the time of your post, but did you ever find out how to get the reverse and tangent curves to be labelled correctly in the reports?

 

I started another thread before I found this one....here is a link to what I have so far:

http://forums.autodesk.com/t5/AutoCAD-Civil-3D-Customization/Parcel-Reports-to-show-quot-reverse-cur...

 

All I can do is find out where the if then statements are...and some of the relevant functions are.  Haven't found the underlying culprit yet....

Civil 3D 2014
Windows 7 x64
Valued Mentor
stacy.dunn
Posts: 385
Registered: ‎10-03-2008
Message 3 of 24 (823 Views)

Re: XML Parcel Legal Description Errors

03-12-2012 04:16 PM in reply to: lsssurvey

 

I had to edit the functions that check for tangency in "LegalDescription_Layout.xsl".

 

function IsNextCurveCompound(index)
{
	var i = parseInt(index);
	var geoele = GeomArray[i];
	
	var bIsNextCurveCompound = false;
	
	if(i < GeomArray.length)
	{
		var nextEle = GeomArray[i + 1];
		if(nextEle)
		{
			if(geoele.type == "Curve")
			{
			    // direction of centerpoint to end of curve
				var curDir = GetCurveEndDirection(i);
				
				//ahead curve				
				if(nextEle.type == "Curve")
				var nextDir = GetCurveStartDirection(i+1);
				{		
					var err = Math.abs(curDir - nextDir);
					if(err < 1)
					{
					//is a reverse curve
						bIsNextCurveCompound = true;
					}
				}
			}

		}
	}
	return bIsNextCurveCompound;
}

 

 

function IsNextTangent(index)
{
	var i = parseInt(index);
	var geoele = GeomArray[i];
	
	var bIsTangent = false;
	
	if(i < GeomArray.length)
	{
		var nextEle = GeomArray[i + 1];
		if(nextEle)
		{
			if(geoele.type == "Line")
			{
				var lineDir = GetLineDirection(i);
				if(nextEle.type == "Curve")
				{
					var curDir = GetCurveStartDirection(i + 1);
					var adjDir = curDir + 90;
					var err = Math.abs(adjDir - lineDir);
					if(err > 180.0) err -= 180.0;
					if(err < .01 ||
						Math.abs(err - 180.0) < .01)
					{
						bIsTangent = true;
					}
				}
				else if(nextEle.type == "Spiral")
				{
					bIsTangent = true;
				}
			}
			// edited to fix math bug srd
			else if(geoele.type == "Curve")
			{
			    // direction of centerpoint to end of curve
				var curDir = GetCurveEndDirection(i);
				//ahead tangent of current curve
				var adjDir = curDir + 90;
				var nextDir = GetCurveStartDirection(i+1);
				var nextadjDir = nextDir - 90;
			
				if(nextEle.type == "Line")
				{
					var linDir = GetLineDirection(i + 1);
					var err = Math.abs(adjDir - linDir);
						if(err > 180.0) err -= 180.0;
					if(err < .01 ||
						Math.abs(err - 180.0) < .01)
					{
						bIsTangent = true;
					}
				}
				else if(nextEle.type == "Curve")
				{		
					var err = Math.abs(adjDir - nextadjDir);
						if(err > 180.0) err -= 180.0;
					if(err < .01 ||
						Math.abs(err - 180.0) < .01)
					{
						bIsTangent = true;
					}
				}
				else if(nextEle.type == "Spiral")
				{
					bIsTangent = false;
				}
			}
			else if(geoele.type == "Spiral")
			{
				bIsTangent = true;
			}
		}
	}
	
	return bIsTangent;
}

 

and a few in "CoordGeometry.xsl"

// added by srd
function GetCurveReverseStartDirection(index)
{
	var curve = GeomArray[index];
	if(curve.type != "Curve")
	{
		return 0;
	}
	var dir = CalculateDirection(curve.EndN, curve.EndE, curve.CenterN, curve.CenterE);
	return dir;
}

 

//re-written to get general direction of chord bearing srd
function GetDirectionOfCurveRun(index)
{
	var runDir = GetChordDirection(index);
	if(runDir >= 0 & runDir < 90)
	{
			return "northeasterly";
	} 
		else if(runDir >= 90 & runDir < 180)
	{
			return "northwesterly"
	}
		else if(runDir >= 180 & runDir < 270)
	{
			return "southwesterly"
	}
		else if(runDir >= 270 & runDir < 360)
	{
			return "southeasterly"
	}
	else
	{
	return "****"
	}
	return "CurveRunDirection";
}

 

//re-written to get general direction of chord bearing srd
function GetDirectionOfCurveRun(index)
{
	var runDir = GetChordDirection(index);
	if(runDir >= 0 & runDir < 90)
	{
			return "northeasterly";
	} 
		else if(runDir >= 90 & runDir < 180)
	{
			return "northwesterly"
	}
		else if(runDir >= 180 & runDir < 270)
	{
			return "southwesterly"
	}
		else if(runDir >= 270 & runDir < 360)
	{
			return "southeasterly"
	}
	else
	{
	return "****"
	}
	return "CurveRunDirection";
}

 

Stacy Dunn
Valued Contributor
rick.hberg
Posts: 75
Registered: ‎06-27-2011
Message 4 of 24 (817 Views)

Re: XML Parcel Legal Description Errors

03-12-2012 05:19 PM in reply to: stacy.dunn

Hi Stacy, Thanks for the help.

 

I did not find your first function (IsNextCurveCompound) within the "LegalDescription_Layout.xsl". I tried to add it anyway, but to no avail - same compound non-tangent curve to curve.

 

I assume I'm missing something else that would call this function? (I shouldn't be guessing here....seeing all the edits you had to make, I would have never made it myself).

 

Thanks a ton for the help.:smileyhappy:

Civil 3D 2014
Windows 7 x64
Valued Mentor
stacy.dunn
Posts: 385
Registered: ‎10-03-2008
Message 5 of 24 (797 Views)

Re: XML Parcel Legal Description Errors

03-13-2012 07:09 AM in reply to: lsssurvey

Take a look at the attached file.  It contains the modified report files for c3d 2011.  They need to be put in "C:\ProgramData\Autodesk\C3D 2011\enu\Data\Reports\xsl" if you use them directly.  Otherwise take a look for any additional modifications that your files don't have.

Stacy Dunn
Active Contributor
lsssurvey
Posts: 38
Registered: ‎06-27-2008
Message 6 of 24 (790 Views)

Re: XML Parcel Legal Description Errors

03-13-2012 07:25 AM in reply to: stacy.dunn

Stacy:

 

I didn't see a file attachment.

 

Tom

Valued Mentor
stacy.dunn
Posts: 385
Registered: ‎10-03-2008
Message 7 of 24 (787 Views)

Re: XML Parcel Legal Description Errors

03-13-2012 07:31 AM in reply to: lsssurvey

here it is.

Stacy Dunn
Valued Contributor
rick.hberg
Posts: 75
Registered: ‎06-27-2011
Message 8 of 24 (775 Views)

Re: XML Parcel Legal Description Errors

03-13-2012 10:33 AM in reply to: stacy.dunn

Many many thanks Stacy!

 

The only issue I noticed was that it will output a Non-Tangent Reverse curve as Non-Tangent Compound curve.  However, I noticed that with the format of your legal descriptions you don't show that information on a non-tangent curve anyway....so it probably wouldn't affect you.

 

I'll try to find that one little thing, but again thank you very much.  This has definitely saved a lot of hours for me!

Civil 3D 2014
Windows 7 x64
Valued Mentor
stacy.dunn
Posts: 385
Registered: ‎10-03-2008
Message 9 of 24 (769 Views)

Re: XML Parcel Legal Description Errors

03-13-2012 11:04 AM in reply to: lsssurvey

Thanks for the heads up on the inconsistency.  I will add it to my list, but it may be a while before I can get to it.

 

I treat all non-tangent curves the same since I site the concave direction and since by definition compound and reverse curves are tangent to the previous segment. 

 

Im glad it helped  you out.

Stacy Dunn
Valued Contributor
rick.hberg
Posts: 75
Registered: ‎06-27-2011
Message 10 of 24 (745 Views)

Re: XML Parcel Legal Description Errors

03-15-2012 06:52 AM in reply to: stacy.dunn

Stacy, your right.  I was trying to help surveying get this working, so I was just spitting out all the labels to check.....

 

So then, all I did based on the fact that a curve-to-curve is either reverse, compound, or non-tangent,  was remove the compound checks if it is a non-tangent curve-to-curve.

 

So in the "GeneralLegalPhrasings.xml", I removed nontangentcompoundcurve and nontangentreversecurve, and replaced with just a nontangentcurve (I have only modified the "Parcel" portion thus far - I don't know what else, if any don't work):

		</Geometry>
		<Geometry type="Parcel">
			<Bounds>
				<Bound type="POB">From the <b> POINT OF BEGINNING</b>;  </Bound>
			</Bounds>
			<Metes>
				<Mete type="Line" connect="Line">Thence, {lineDirection} for a distance of {lineDistanceFoot} feet to a point on a line.  </Mete>
				<Mete type="Line" connect="Point">Thence, {lineDirection} for a distance of {lineDistanceFoot} feet to a point on the boundary.  </Mete>
				<Mete type="Line" connect="PointOfBegining">thence {lineDirection} a distance of {lineDistanceFoot} feet to the <b> POINT OF BEGINNING</b>; </Mete>
				<Mete type="Line" connect="TangentCurve">Thence,   {lineDirection}  for a distance of {lineDistanceFoot}  feet to the beginning of a curve, </Mete>
				<Mete type="Line" connect="NonTangentCurve">Thence,  {lineDirection} for a distance of {lineDistanceFoot} feet to the beginning of a non-tangential curve, </Mete>
				<Mete type="Curve" connect="TangentLine">Said curve turning to the {curveRotation} through an angle of {curveAngle}, having a radius of {curveRadiusFoot} feet, and whose long chord bears {curveChordDirection} for a distance of {curveChordLengthFoot} feet. </Mete>
				<Mete type="Curve" connect="NonTangentLine">Said curve turning to the {curveRotation} through an angle of {curveAngle}, having a radius of {curveRadiusFoot} feet, and whose long chord bears {curveChordDirection} for a distance of {curveChordLengthFoot} feet to a point of intersection with a non-tangential line. </Mete>
				<Mete type="Curve" connect="TangentCompoundCurve">Said curve turning to the {curveRotation} through {curveAngle}, having a radius of {curveRadiusFoot} feet, and whose long chord bears {curveChordDirection} for a distance of {curveChordLengthFoot} feet to the beginning of a curve.  </Mete>
				<Mete type="Curve" connect="NonTangentCurve">Said curve turning to the {curveRotation} through {curveAngle}, having a radius of {curveRadiusFoot} feet, and whose long chord bears {curveChordDirection} for a distance of {curveChordLengthFoot} feet to the beginning of a non-tangential curve.</Mete>
				<Mete type="Curve" connect="TangentReverseCurve">Said curve turning to the {curveRotation} through {curveAngle}, having a radius of {curveRadiusFoot} feet, and whose long chord bears {curveChordDirection} for a distance of {curveChordLengthFoot} feet to the beginning of a reverse curve.  </Mete>
				<Mete type="Curve" connect="PointOfBegining">Said curve turning to the {curveRotation} through {curveAngle}, having a radius of {curveRadiusFoot} feet, and whose long chord bears {curveChordDirection} for a distance of {curveChordLengthFoot} feet to the <b> POINT OF BEGINNING</b>.  </Mete>
			</Metes>
		</Geometry>

 

 So in the "LegalDescription_Layout.xsl", I just modified the 'if not tangent' portion under the GetLegalForCurve function that you provided to use the nontangentcurve above and not bother with checking for compound/reverse:

function GetLegalForCurve(index)
	////---2012-03-13 rjh editted ---------srd creditted-------------------------------------------------
	////----removed non-tangent compound/reverse-------only compound, reverse, or non-tangent curves-----
{      
	var i = parseInt(index);
	var geoele = GeomArray[i];
	var nextEle = GeomArray[i + 1];
	var retStr = geoele.type + index + " ";
	
	if(nextEle)
	{
		var bTangent = IsNextTangent(i);
		if(nextEle.type == "Line")
		{
			var xmlEle;
			
			if(bTangent == true)
			{
				xmlEle = xmlGeom.selectSingleNode("Metes/Mete[@type='Curve' and @connect='TangentLine']");
			}
			else
			{
				xmlEle = xmlGeom.selectSingleNode("Metes/Mete[@type='Curve' and @connect='NonTangentLine']");
			}
			//var subStr = xmlEle.text;
			var subStr = GetInnerXML(xmlEle);
				
			retStr = SubstituteCurveKeywords(index, subStr);
		}
		else if(nextEle.type == "Curve")
		{
			var xmlEle;
			
			if(bTangent == true)
			{
				//var check = CompareNextCurveDirection(i);
				//if(check == "Compound")

				var CompoundCheck = IsNextCurveCompound(i);
				if(CompoundCheck == true)
				{
					xmlEle = xmlGeom.selectSingleNode("Metes/Mete[@type='Curve' and @connect='TangentCompoundCurve']");
				}
				//else if(check == "Reverse")

				else if(CompoundCheck == false)
				{
					xmlEle = xmlGeom.selectSingleNode("Metes/Mete[@type='Curve' and @connect='TangentReverseCurve']");
				}
				//var subStr = xmlEle.text;
				var subStr = GetInnerXML(xmlEle);
				
				retStr = SubstituteCurveKeywords(index, subStr);
			}
			else
			{
				xmlEle = xmlGeom.selectSingleNode("Metes/Mete[@type='Curve' and @connect='NonTangentCurve']");
				var subStr = GetInnerXML(xmlEle);
				retStr = SubstituteCurveKeywords(index, subStr);
			}

				//var check = CompareNextCurveDirection(i);
				//if(check == "Compound")
				//{
				//	xmlEle = xmlGeom.selectSingleNode("Metes/Mete[@type='Curve' and @connect='NonTangentCompoundCurve']");
				//}
				//else if(check == "Reverse")
				//{
					xmlEle = xmlGeom.selectSingleNode("Metes/Mete[@type='Curve' and @connect='NonTangentReverseCurve']");
				//}
				//var subStr = xmlEle.text;
				//var subStr = GetInnerXML(xmlEle);
				
				//retStr = SubstituteCurveKeywords(index, subStr);
			//}
		}
		else
		{
			retStr = "CurveToOther ";
		}
	}
	
	return retStr;
}

 These other two (IsNextCurveCompound and IsNextTangent functions) are unchanged from your original and located in "LegalDescription_Layout.xsl". I'm just showing them in case others stumble across this post.  So what's shown here is everything needed to get it working properly if starting from the default installed files (IsNextCurveCompound is an addition to the file, and IsNextTangent is an overwrite to the existing function). From there, everything else is just to get the desired formatting in the output.

///-------2012-03-13-------srd add function to check compound/reverse-----------------
function IsNextCurveCompound(index)
{
	var i = parseInt(index);
	var geoele = GeomArray[i];
	
	var bIsNextCurveCompound = false;
	
	if(i < GeomArray.length)
	{
		var nextEle = GeomArray[i + 1];
		if(nextEle)
		{
			if(geoele.type == "Curve")
			{
			    // direction of centerpoint to end of curve
				var curDir = GetCurveEndDirection(i);
				
				//ahead curve				
				if(nextEle.type == "Curve")
				var nextDir = GetCurveStartDirection(i+1);
				{		
					var err = Math.abs(curDir - nextDir);
					if(err < 1)
					{
					//is a reverse curve
						bIsNextCurveCompound = true;
					}
				}
			}

		}
	}
	return bIsNextCurveCompound;
}


function IsNextTangent(index)
{
	var i = parseInt(index);
	var geoele = GeomArray[i];
	
	var bIsTangent = false;
	
	if(i < GeomArray.length)
	{
		var nextEle = GeomArray[i + 1];
		if(nextEle)
		{
			if(geoele.type == "Line")
			{
				var lineDir = GetLineDirection(i);
				if(nextEle.type == "Curve")
				{
					var curDir = GetCurveStartDirection(i + 1);
					var adjDir = curDir + 90;
					var err = Math.abs(adjDir - lineDir);
					if(err > 180.0) err -= 180.0;
					if(err < .01 ||
						Math.abs(err - 180.0) < .01)
					{
						bIsTangent = true;
					}
				}
				else if(nextEle.type == "Spiral")
				{
					bIsTangent = true;
				}
			}
	////-----2012-03-13----srd edit---Curve to Curve tangent check-----------
	////---------------------------------------------------------------------
			else if(geoele.type == "Curve")

			{
				var curDir = GetCurveEndDirection(i);
				var adjDir = curDir + 90;
				if(nextEle.type == "Line")
				{
					var linDir = GetLineDirection(i + 1);
					var err = Math.abs(adjDir - linDir);
					if(err > 180.0) err -= 180.0;
					if(err < .01 ||
						Math.abs(err - 180.0) < .01)
					{
						bIsTangent = true;
					}
				}
				else if(nextEle.type == "Curve")
				{
					//var cCurDir = GetCurveDirection(i + 1);
					//if(adjDir == cCurDir + 90)
					//{
					//	bIsTangent = false;
					//}

					var cCurDir = GetCurveStartDirection(i + 1);
					var adjcCurDir = cCurDir - 90;
					var err = Math.abs(adjDir - adjcCurDir);
						if(err > 180.0) err -= 180.0;
					if(err < .01 ||
						Math.abs(err - 180.0) < .01)
					{
						bIsTangent = true;
					}
				}
				else if(nextEle.type == "Spiral")
				{
					bIsTangent = false;
				}
			}
			else if(geoele.type == "Spiral")
			{
				bIsTangent = true;
			}
		}
	}
	
	return bIsTangent;
}

 Thanks again.

Civil 3D 2014
Windows 7 x64
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.