SDK:Parametric Custom Opening in Wall

From Vectorworks Developer
Jump to navigation Jump to search

.SDK|SDK ..SDK:Types|SDK Types ..SDK:Using the SDK|Using the SDK ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

By Vladislav Stanev

What's that

When you have a parametric object in put inside a wall, the wall creates opening by the convex hull polygon in 2D and convex hull cube in 3D, created by the 2D and 3D geometry of the parametric.

From VectorWorks 2009 parametric objects are capable of customizing the opening that the parametric object will cut into the wall when placed inside.

The opening is customizable only in 3D.

The opening is created by boolean operation with the 3D geometry specified from the parametric object and the wall 3D body.

NOTE! The geometry that determines the selection indication is kepts inside each instance. The custom opening is definable only in 3D.

Creating

The plug-in creates geometry that is to be used as opening cutting geometry and puts it into special group with the call VCOM:VectorWorks:ISDK::SetCustomObjectWallHoleGroup.

You can pass handle to what ever 3D object or handle to group object that contains 3D geometry.

case kParametricRecalculate : {

  // -------------------------------------------------------
  // Custom wall opening
  MCObjectHandle	hOpExtrudeBase	= gSDK->CreatePolyshape();
  gSDK->AddVertex( hOpExtrudeBase, WorldPt(-100,-100), vtCorner, 0, false );
  gSDK->AddVertex( hOpExtrudeBase, WorldPt(0,-50), vtCorner, 0, false );
  gSDK->AddVertex( hOpExtrudeBase, WorldPt(100,-100), vtCorner, 0, false );
  gSDK->AddVertex( hOpExtrudeBase, WorldPt(100,100), vtCorner, 0, false );
  gSDK->AddVertex( hOpExtrudeBase, WorldPt(0,50), vtCorner, 0, false );
  gSDK->AddVertex( hOpExtrudeBase, WorldPt(-100,100), vtCorner, 0, false );
  gSDK->SetPolyShapeClose( hOpExtrudeBase, true );

  // create extrude for cutting the wall
  // NOTE: The plug-in must ensure that the cutting 3D geometry
  // goes all the way through the wall.
  MCObjectHandle	hOpExtrude		= gSDK->CreateExtrude( -1000, 1000 );
  gSDK->AddObjectToContainer( hOpExtrudeBase, hOpExtrude );
  gSDK->SetEntityMatrix( hOpExtrude, transfMat );

  // set the cutting geometry
  gSDK->SetCustomObjectWallHoleGroup( objHand, hOpExtrude );


The way it works is that the plug-in provides 3D geometry that is used to cut through the wall.

This way the plug-in parametric object can control the opening. Do recess and sloped openings. Also if you specify a group containing several 3D bodies you can create separate independent openings in the wall for this parametric.

See also

SDK:Plug-in Object Events | SDK:Parametric Object Plug-in