CAD/CAM discussion forum > CAD > Create DBPoint

Create DBPoint

    
  Subscribe Topic

Rank: 4

Goran

Senior Engineer

posts: 77

Registered: 2011-7-16

Message 1 of 4

 Create DBPoint
08-03-2017 03:28 . am   |   View his/her posts only
Post Last Edit by goranP at 2017-3-8 03:36

Post Last Edit by goranP at 2017-3-8 03:32

Post Last Edit by goranP at 2017-3-8 03:29

VERNUM = "2017.01.23(13656)_x64" (read only)

Unable to create point in 'normal' way - coordinate N is allwajs 0(zero).
Create point in 0,0,0 then 'move it' (transform) to designated place.

public static void createPT(Transaction tr, BlockTableRecord btr, string sLayerName, Point3d pntCoord)
{
#if ZWCAD_2014 || ZWCAD_2015
DBPoint zwPt = new DBPoint(pntCoord);
#elif ZWCAD_2017_64
Point3d pt3d = new Point3d(0, 0, 0);
DBPoint zwPt = new DBPoint(pt3d);
Vector3d acVec3d = pt3d.GetVectorTo(pntCoord);
zwPt.TransformBy(Matrix3d.Displacement(acVec3d));
#endif
zwPt.Layer = sLayerName;
btr.AppendEntity(zwPt);
tr.TransactionManager.AddNewlyCreatedDBObject(zwPt, true);
}

I think that is all for tonight. Version 2018 must be something awsome, and very fast!!!!!!!!!!!!!
Or you will be out of the job, as I will be too


Edit: this is for 64b version, didn't try with 32b.

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 384

Registered: 2015-6-9

Message 2 of 4

16-03-2017 03:10 . pm   |   View his/her posts only
Reply 1# goranP


Hi Goran, I tried to run the code you attached in ZWCAD 2015 or 2017. Both cannot work normally.
Does it work in your side of ZWCAD 2015?

Rank: 4

Goran

Senior Engineer

posts: 77

Registered: 2011-7-16

Message 3 of 4

18-03-2017 02:42 . am   |   View his/her posts only
Yes they can, but never both of them.

I use same code for ZwCad+ 2014, ZwCad+ 2015, ZwCad 2017 64 bit and ZwCad 2017 32 bit. Is there are any diferences in code regardin version of ZwCad, you can resolve that issue using conditional compilation symbols (Visual Studio).
I think that there is no need to explain if-then-else (elif).

#if ZWCAD_2014 || ZWCAD_2015
THIS SECTION OF CODE WILL COMPILE ONLY IF CONDITIONAL SYMBOL IS SET FOR ZWCAD 2014 OR 2015
#elif ZWCAD_2017_64
THIS SECTION OF CODE WILL COMPILE ONLY IF CONDITIONAL SYMBOL IS SET FOR ZWCAD 2017
#endif

Picture 1

picture 1.PNG
7 DayBefore 02:39

Picture 1 - project properties for ZwCad2017

Picture 2

picture 2.PNG
7 DayBefore 02:39

Picture 2 - how Visual Studio show that code

If you don't use conditional symbols, you must use first or seccond lines of code. so do this (please:-)) in ZwCad 2017:

public static void createPT(Transaction tr, BlockTableRecord btr, string sLayerName, Point3d pntCoord)
{
DBPoint zwPt = new DBPoint(pntCoord);
zwPt.Layer = sLayerName;
btr.AppendEntity(zwPt);
tr.TransactionManager.AddNewlyCreatedDBObject(zwPt, true);
}

N coordinates is 0 (zero)! Same code compiled for 2014 or 2015 works fine.
I can send you short movie.

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 384

Registered: 2015-6-9

Message 4 of 4

20-03-2017 12:00 . pm   |   View his/her posts only
Reply 3# goranP


Hi Goran, We reproduced the issue, and the bug ID is T13448. Thank you.
We will fix it ASAP.
See also
X