Author Topic: bricscad 2016 64bits error on create dbpoint  (Read 2393 times)

0 Members and 1 Guest are viewing this topic.

neyton

  • Newt
  • Posts: 67
bricscad 2016 64bits error on create dbpoint
« on: March 03, 2016, 01:21:19 PM »
Hi,

this code:

...
Code - vb.net: [Select]
  1. Dim pt as new point3d(1,1,1)
  2. Dim pEnt As New DBPoint( pt )
  3. ' add pEnt to model space
  4.  
  5. 'not set Y and Z to pEnt in bricscad 2016 64bits.


to work:

Code - vb.net: [Select]
  1. Dim pt as new point3d(1,1,1)
  2. Dim pEnt As New DBPoint
  3. pEnt.location = pt


why????
« Last Edit: March 04, 2016, 09:35:52 PM by John Kaul (Se7en) »
Visit my website: http://tbn2.blogspot.com

owenwengerd

  • Bull Frog
  • Posts: 444
Re: bricscad 2016 64bits error on create dbpoint
« Reply #1 on: March 03, 2016, 06:15:12 PM »
Sounds like a bug. Please submit a support request so someone from Bricsys can have a look and get it fixed.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7096
  • AKA Daniel
Re: bricscad 2016 64bits error on create dbpoint
« Reply #2 on: March 04, 2016, 08:09:32 PM »
works in C#

Code - C#: [Select]
  1. public static class Commands
  2.     {
  3.         [CommandMethod("test")]
  4.         static public void test()
  5.         {
  6.             Database database = HostApplicationServices.WorkingDatabase;
  7.             DBPoint dbpoint = new DBPoint(new Point3d(1, 1, 1));
  8.             AddToModelSpace(database, dbpoint);
  9.         }
  10.  
  11.         public static ObjectIdCollection AddToModelSpace(Database database, params Entity[] list)
  12.         {
  13.             ObjectIdCollection ids = new ObjectIdCollection();
  14.             AcDb.TransactionManager manager = database.TransactionManager;
  15.             using (Transaction action = manager.StartTransaction())
  16.             {
  17.                 BlockTable blockTable =
  18.                     action.GetObject(database.BlockTableId, OpenMode.ForRead) as BlockTable;
  19.                 if (blockTable == null)
  20.                     throw new System.NullReferenceException("blockTable == null");
  21.  
  22.                 BlockTableRecord blockTableRecord =
  23.                     action.GetObject(blockTable[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
  24.                 if (blockTableRecord == null)
  25.                     throw new System.NullReferenceException("blockTableRecord == null");
  26.  
  27.                 foreach (Entity ent in list)
  28.                 {
  29.                     ids.Add(blockTableRecord.AppendEntity(ent));
  30.                     action.AddNewlyCreatedDBObject(ent, true);
  31.                 }
  32.                 action.Commit();
  33.             }
  34.             return ids;
  35.         }
  36.     }
  37.  
Retired

kdub

  • Mesozoic keyThumper
  • SuperMod
  • Swamp Rat
  • Posts: 1387
  • class keyThumper<T>:ILazy<T>
Re: bricscad 2016 64bits error on create dbpoint
« Reply #3 on: March 04, 2016, 11:23:34 PM »

Hi Daniel,

It always makes me feel warm and fuzzy when I see methods like AddToModelSpace()

Does BricsCAD use Extension Methods ?? ( I assume so , as they are implemented through  .NET not the API)

Do you know why the BricsCad sample code used a variable named action for the Transaction instance ??
called Kerry in my other life

Sometimes the question is more important than the answer.
#ridesober

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7096
  • AKA Daniel
Re: bricscad 2016 64bits error on create dbpoint
« Reply #4 on: March 04, 2016, 11:33:16 PM »
Do you know why the BricsCad sample code used a variable named action for the Transaction instance ??

transactionInator was too long
Retired

kdub

  • Mesozoic keyThumper
  • SuperMod
  • Swamp Rat
  • Posts: 1387
  • class keyThumper<T>:ILazy<T>
Re: bricscad 2016 64bits error on create dbpoint
« Reply #5 on: March 05, 2016, 01:38:26 AM »
Do you know why the BricsCad sample code used a variable named action for the Transaction instance ??

transactionInator was too long

Perfectly sensible !!
called Kerry in my other life

Sometimes the question is more important than the answer.
#ridesober

neyton

  • Newt
  • Posts: 67
Re: bricscad 2016 64bits error on create dbpoint
« Reply #6 on: March 07, 2016, 09:04:23 AM »
You tested this code in bricscad 2016 64 bits?

Visit my website: http://tbn2.blogspot.com

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7096
  • AKA Daniel
Re: bricscad 2016 64bits error on create dbpoint
« Reply #7 on: March 07, 2016, 07:50:48 PM »
You tested this code in bricscad 2016 64 bits?

its a bug! file a request
« Last Edit: March 07, 2016, 08:03:51 PM by nullptr »
Retired