I'm glad you like it, Sinc. I'm also completely befuddled.....
I zipped up my version of SincPac, placed your VS version in my projects folder, compiled, and it works just fine, as you said. So I went back and did a side by side comparison, with the exception of 2 references I didn't need I couldn't find any major differences that would make yours work but not mine.
* Jeff_M ***<throws hands in air>***
I give up. I spent about 5 hours over the past few days chasing this error, no more. Did I metion I'm glad you switched to VS C#?
So here's the whole reason I was trying this in the first place.....I just wanted to add the lisp routine I wrote last year to rotate points. Someone had posted that it was giving them the dreaded "unwind skipped on unkown exception" error. So I thought if it was written in C# I might eliminate that problem, and it would probably run quicker, too. By using your tools I figured it would cut down on the development time AND it could be added to your package, as you did ask for code contributions.
I do have both 2007 & 2008 installed and was starting to think my problem was related to that. But since yours works just fine, I've eliminated that possibility. So I've now just deleted my feeble attempts to convert your code and will just use what you posted. Thanks again!
Oh, one other reason I prefer VS C# is because I could never figure out how to run in Debug mode in SD. In VS C# it's pretty simple to setup debugging, and I learned from Kerry about using a script that opens a specific test drawing and loads the DLL.
Here's my contribution:
/*
* User: Jeff Mishler
* Date: 4/16/2007
* Time: 7:24 AM
*
*/
using System;
using Autodesk.AECC.Interop.Land;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Interop;
using Autodesk.AutoCAD.Runtime;
using Civil3DUtilities;
namespace SincPac.RotatePoints
{
/// <summary>
/// Description of RotatePoints. Code to set the rotation
/// angle of C3D points. Written to be a part of Edward-James Surveying's
/// excellent SincPac C3D routines.
///
/// To Do: determine what the current rotation value is, as defined
/// by the Point Marker Style, and calculate the desired angle factoring in
/// the style's angle. Right now it just sets the point's rotation angle to the
/// input value, but it may not display as desired due to the style's, both the
/// point and point group, angle being applied.
/// </summary>
public class RotatePoints
{
public RotatePoints()
{
}
public double rotpts_angle;
[CommandMethod("ROTPTS")]
public void RotatePointsCommand()
{
try
{
C3DUtil c3dUtil = new C3DUtil();
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
AeccPoints aeccpoints = c3dUtil.AeccDb.Points;
PromptAngleOptions prmpt = new PromptAngleOptions ("\nAngle to rotate points to:");
prmpt.DefaultValue = rotpts_angle;
prmpt.AllowArbitraryInput = false;
prmpt.UseDefaultValue = true;
PromptDoubleResult pres;
pres = ed.GetAngle(prmpt);
ed.WriteMessage("\nSelect points to rotate:");
int[] ptNumList = (int[])c3dUtil.AeccDoc.SelectPoints();
foreach (int PointNum in ptNumList)
{
AeccPoint aeccpt = aeccpoints.Find(PointNum);
aeccpt.Rotation = pres.Value;
}
rotpts_angle = pres.Value;
if (ptNumList.GetUpperBound(0) == 0)
{
ed.WriteMessage("\nRotated 1 point. ");
}
else
{
ed.WriteMessage("\nRotated {0} points. ", ptNumList.GetUpperBound(0) + 1);
}
}
catch
{
}
}
}
}