TheSwamp
Code Red => .NET => Topic started by: Daniel Eiszele on April 19, 2011, 06:40:49 PM
-
Bricscad gets .NET in the latest beta. Haven't played with it yet but it's just a little bit exciting :lol: Shouldn't be too long till it makes it to the bigtime.
-
Daniel,
Is that Bricscad version 11.3.6-1 en_US (Beta)
-
Yep that's the one. I compiled the provided examples in Sharp Develop and it ran without a hitch.
-
*woot*
and the SOLPROF COMMAND
added:
Just received the email notification ..
-
It seems pretty snappy too, time for me to get back in the .net game :laugh:
-
It seems pretty snappy too, time for me to get back in the .net game :laugh:
Me too .. now is a very opportune time :)
//-------
It's a while since I've fired up Bricscad ... had to ask for a new License Key :-)
-
Figures!
I just committed to a large arx program..
-
i'm the first 8-)
using System;
using System.Diagnostics;
using System.Collections.Generic;
using Teigha.Runtime;
using Teigha.DatabaseServices;
using Teigha.Geometry;
using Bricscad.ApplicationServices;
using Bricscad.Runtime;
using Bricscad.EditorInput;
using AcAp = Bricscad.ApplicationServices;
using AcDb = Teigha.DatabaseServices;
using AcGe = Teigha.Geometry;
using AcEd = Bricscad.EditorInput;
[assembly: CommandClass(typeof(CsDanTheMan.Commands))]
namespace CsDanTheMan
{
public class Commands
{
[CommandMethod("doit")]
static public void doitisay()
{
Editor editor = AcAp.Application.DocumentManager.MdiActiveDocument.Editor;
try
{
Stopwatch sw = Stopwatch.StartNew();
int bzillion = 100;
Func<int, List<DBPoint>> pointMaker = delegate(int _bzillion)
{
var points = new List<DBPoint>(_bzillion * _bzillion * _bzillion);
for (int i = 0; i < _bzillion; i++)
for (int k = 0; k < _bzillion; k++)
for (int l = 0; l < _bzillion; l++)
points.Add(new DBPoint(new Point3d(i, k, l)));
return points;
};
Func<BlockTableRecord, Transaction, Entity, ObjectId> actionHelper =
delegate(BlockTableRecord _rec, Transaction _action, Entity _ent)
{
_action.AddNewlyCreatedDBObject(_ent, true);
return _rec.AppendEntity(_ent);
};
var ids = new ObjectIdCollection();
var database = HostApplicationServices.WorkingDatabase;
var manager = database.TransactionManager;
using (var action = manager.StartTransaction())
{
var blockTable =
action.GetObject(database.BlockTableId, OpenMode.ForRead) as BlockTable;
if (blockTable == null)
return;
var blockTableRecord =
action.GetObject(blockTable[BlockTableRecord.ModelSpace],
OpenMode.ForWrite) as BlockTableRecord;
if (blockTableRecord == null)
return;
var list = pointMaker.Invoke(bzillion);
list.ForEach(point => ids.Add(actionHelper(blockTableRecord, action, point)));
action.Commit();
editor.WriteMessage("\n{0} Entities created in {1} Milliseconds",
list.Count, sw.ElapsedMilliseconds);
}
}
catch (System.Exception ex)
{
editor.WriteMessage("\nError: {0}\nStackTrace: {1}", ex.Message, ex.StackTrace);
}
}
}
}
-
pretty snappy too
-
[CommandMethod("doit")]
public void test()
{
Bitmap bitmap = new Bitmap("C:\\zot.bmp");
Database db = AcAp.Application.DocumentManager.MdiActiveDocument.Database;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
AcDb.BlockTableRecord currentSpace = tr.GetObject
(db.CurrentSpaceId, OpenMode.ForWrite) as AcDb.BlockTableRecord;
for (int i = 0; i < bitmap.Width; i++)
{
for (int j = 0; j < bitmap.Height; j++)
{
DBPoint point = new DBPoint();
Teigha.Colors.Color color =
Teigha.Colors.Color.FromColor(bitmap.GetPixel(i, j));
point.Color = color;
double z = (color.ColorValue.R + color.ColorValue.G + color.ColorValue.B) * 0.01;//change this
point.Position = new Point3d(i, j, z);
currentSpace.AppendEntity(point);
tr.AddNewlyCreatedDBObject(point, true);
}
}
tr.Commit();
}
-
Is Bricscad built on OpenDesign API?
Wouldn't surprise me.
They (OpenDesign) have had .NET for dwgs for a while now.