developer:sdksamples:blockinsertionpoint


Obtaining the Insertion Point of a Block

C++, .NET

Summary: Demonstrates how to obtain the insertion point of a block.

Question

How to get the basepoint coordinates (x,y,z) of a block instance?

Answer

See the following sample code:

For example:

C++

ON_3dPoint BlockInstanceInsertionPoint(const CRhinoInstanceObject* instance_obj)
{
  ON_3dPoint pt = ON_UNSET_POINT;
  if (instance_obj != 0)
  {
    pt = ON_origin;
    pt.Transform(instance_obj->InstanceXform());
  }
  return pt;
}

C#

public On3dPoint BlockInstanceInsertionPoint(IRhinoInstanceObject instance_obj)
{
  On3dPoint pt = new On3dPoint(OnUtil.On_UNSET_POINT);
  if (instance_obj != null)
  {
    pt.Set(OnUtil.On_origin);
    pt.Transform(instance_obj.InstanceXform());
  }
  return pt;
}
developer/sdksamples/blockinsertionpoint.txt · Last modified: 2010/01/26 16:37 (external edit) Driven by DokuWiki Recent changes RSS feed

 © 1997-2010 

McNeel North America Europe Latin AmericaAsia