How to add a block in a CADImage ?
Moderators: SDS, support, admin
How to add a block in a CADImage ?
Hello
I found out how added a circle in a CADImage:
ActiveX_Point = new Automation object "CADViewLib.Point3D"
ActiveX_Cercle = new Automation object "CADViewLib.Circle"
Plan_ActiveX = new Automation object "CADViewLib.CADViewX"
ActiveX_Point >> x = 0
ActiveX_Point >> y = 0
ActiveX_Point >> z = 0
ActiveX_Cercle >> Radius = 5
ActiveX_Cercle >> Point = ActiveX_Point
ActiveX_Cercle >> Color = in_Color
Plan_ActiveX >> CADImage >> Converter >> Loads (ActiveX_Cercle)
Plan_ActiveX >> CADImage >> CurrentLayout >> addEntity (ActiveX_Cercle)
Plan_ActiveX >> >> CADImage RefreshCurrentLayout ()
But I can not add a block in a CADImage. How should I do?
For example, how do we add a block of two concentric circles?
I found out how added a circle in a CADImage:
ActiveX_Point = new Automation object "CADViewLib.Point3D"
ActiveX_Cercle = new Automation object "CADViewLib.Circle"
Plan_ActiveX = new Automation object "CADViewLib.CADViewX"
ActiveX_Point >> x = 0
ActiveX_Point >> y = 0
ActiveX_Point >> z = 0
ActiveX_Cercle >> Radius = 5
ActiveX_Cercle >> Point = ActiveX_Point
ActiveX_Cercle >> Color = in_Color
Plan_ActiveX >> CADImage >> Converter >> Loads (ActiveX_Cercle)
Plan_ActiveX >> CADImage >> CurrentLayout >> addEntity (ActiveX_Cercle)
Plan_ActiveX >> >> CADImage RefreshCurrentLayout ()
But I can not add a block in a CADImage. How should I do?
For example, how do we add a block of two concentric circles?
Re: How to add a block in a CADImage ?
Hello.
Block is not a visible entity on drawing but object that can contain entities. The code to add a block reference (Insert entity) is the similar to adding single entity. Block name must be specified to successfully add a block reference to a drawing. However the current library version restricts the Block.Name property as read only. We will change the property access. Editor can be used to add a block in current CADViewX version:
Alexander.
Block is not a visible entity on drawing but object that can contain entities. The code to add a block reference (Insert entity) is the similar to adding single entity. Block name must be specified to successfully add a block reference to a drawing. However the current library version restricts the Block.Name property as read only. We will change the property access. Editor can be used to add a block in current CADViewX version:
Code: Select all
CADViewLib.Group concentric = new CADViewLib.Group();
CADViewLib.Circle mCircle = new CADViewLib.Circle();
mCircle.Point = CADViewX1.MkFPoint(100, 100, 0);
mCircle.Radius = 100;
CADViewX1.CADImage.Converter.Loads((CADViewLib.Entity)mCircle);
concentric.AddEntity((CADViewLib.Entity)mCircle);
mCircle = new CADViewLib.Circle();
mCircle.Point = CADViewX1.MkFPoint(100, 100, 0);
mCircle.Radius = 70;
CADViewX1.CADImage.Converter.Loads((CADViewLib.Entity)mCircle);
concentric.AddEntity((CADViewLib.Entity)mCircle);
Editor.Select((CADViewLib.Entity)concentric);
Editor.Copy();
Editor.PasteAsBlock();
Editor.PasteAtPoint(CADViewX1.MkFPoint(200, 200, 0));
Editor.Clear();
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: How to add a block in a CADImage ?
hello
" ... However the Ellipse.RadPt property that defines the relative end point of ellipse major axis have read-only modifier. Because of this created ellipse will be not correct. We will fix this problem."
Alexander
" ... Name property as read only. We will change the property access."
Alexander
An idea of the release date of the next revision of CADViewX?
" ... However the Ellipse.RadPt property that defines the relative end point of ellipse major axis have read-only modifier. Because of this created ellipse will be not correct. We will fix this problem."
Alexander
" ... Name property as read only. We will change the property access."
Alexander
An idea of the release date of the next revision of CADViewX?
Re: How to add a block in a CADImage ?
Hello Xavier.
Unfortunately we can't provide a date of release of the CADViewX version with the mentioned corrections. Please inform us if you have any other remarks on the library.
Alexander.
Unfortunately we can't provide a date of release of the CADViewX version with the mentioned corrections. Please inform us if you have any other remarks on the library.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: How to add a block in a CADImage ?
Hello Xavier.
We have implemented necessary modifications to the library. A name can be set to a block and the following code can be used to create a block with entities:
The updated version is available for downloading:
http://www.cadsofttools.com/download/cadviewx.zip
Alexander.
We have implemented necessary modifications to the library. A name can be set to a block and the following code can be used to create a block with entities:
Code: Select all
CADViewLib.Block cxBlc = new CADViewLib.Block();
cxBlc.Name = "Concentric_circles";
CADViewX1.CADImage.Converter.get_Sections(CADViewLib.TxConvSection.csBlocks).AddEntity((CADViewLib.Entity)cxBlc);
CADViewLib.Circle mCircle = new CADViewLib.Circle();
mCircle.Point = CADViewX1.MkFPoint(100, 100, 0);
mCircle.Radius = 100;
CADViewX1.CADImage.Converter.Loads((CADViewLib.Entity)mCircle);
cxBlc.AddEntity((CADViewLib.Entity)mCircle);
mCircle = new CADViewLib.Circle();
mCircle.Point = CADViewX1.MkFPoint(100, 100, 0);
mCircle.Radius = 70;
CADViewX1.CADImage.Converter.Loads((CADViewLib.Entity)mCircle);
cxBlc.AddEntity((CADViewLib.Entity)mCircle);
CADViewX1.CADImage.Converter.Loads((CADViewLib.Entity)cxBlc);
CADViewLib.Insert cxIns = new CADViewLib.Insert();
cxIns.Block = cxBlc;
cxIns.Point = CADViewX1.MkFPoint(150, 150, 0);
CADViewX1.CADImage.Converter.Loads((CADViewLib.Entity)cxIns);
CADViewX1.CADImage.CurrentLayout.AddEntity((CADViewLib.Entity)cxIns);
CADViewX1.CADImage.RefreshCurrentLayout();
http://www.cadsofttools.com/download/cadviewx.zip
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: How to add a block in a CADImage ?
Hello
I tested the code in c #.
I thought the line of code "cxIns.Point CADViewX1.MkFPoint = (150, 150, 0);" allowed to indicate the coordinates of the block insertion.
But whatever the chosen coordinates, the block always appears in the same place.
I tested with (0,0,0) then I tested with (150,150,0), the block is in the same place.
Some coordinates even cause irreparable failures.
is this normal? have I misunderstood the functionality of the "cxIns.Point" property ?
Cordially
Xavier
I tested the code in c #.
I thought the line of code "cxIns.Point CADViewX1.MkFPoint = (150, 150, 0);" allowed to indicate the coordinates of the block insertion.
But whatever the chosen coordinates, the block always appears in the same place.
I tested with (0,0,0) then I tested with (150,150,0), the block is in the same place.
Some coordinates even cause irreparable failures.
is this normal? have I misunderstood the functionality of the "cxIns.Point" property ?
Cordially
Xavier
Re: How to add a block in a CADImage ?
Hello Xavier.
The Point property defines placement of an Insert on the drawing. Location of an Insert at (0, 0, 0) while Insert.Point have different values is incorrect. We have fixed this problem and updated the library:
http://www.cadsofttools.com/download/cadviewx.zip
Alexander.
The Point property defines placement of an Insert on the drawing. Location of an Insert at (0, 0, 0) while Insert.Point have different values is incorrect. We have fixed this problem and updated the library:
http://www.cadsofttools.com/download/cadviewx.zip
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: How to add a block in a CADImage ?
thanks
it works.
good day
it works.
good day