Rotating all geometry on a sketch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am tring to create some code that will rotate all the geometry on a sketch. I have tried the following, but it does nothing. I have a feeling that it is due to no geometry being in the ObjectCollection. What is the best way to get an object collection of all sketch entities? Would I have to loop through the lines, arcs, circles, etc collections and add each edge individually to the collection? Also, is there a place I can get more C++ samples, as VB does not show all the steps needed to use the API in C++?
CComPtr<SelectSet> selectset;
tmpdoc->get_SelectSet(&selectset);
selectset->Select(sketch);
CComPtr<ObjectCollection> objcollection;
CComVariant objenumvar(selectset);
transobj->CreateObjectCollection(objenumvar, &objcollection);
CComPtr<ObjectsEnumerator> objenum;
CComPtr<Point2d> center;
transgeom->CreatePoint2d(0.0, 0.0, ¢er);
sketch->RotateSketchObjects(objcollection, center, appdata.m_rotation, VARIANT_FALSE, VARIANT_FALSE, &objenum);