Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void App::on_join()
- {
- try
- {
- // Query user for two entities
- Polyline primary = user_select_entity(L"Select first entity\n").cast<Polyline::db_type>();
- // ...
- Polyline secondary = user_select_entity(L"Select second entity\n").cast<Polyline::db_type>();
- // Open or create layer
- Layer layer = Layer::open(L"test", true);
- // Create joined polyline
- Polyline joined = Polyline::create();
- joined->upgradeOpen();
- joined->setColorIndex(1);
- if (!primary.join(secondary, joined))
- return;
- // And add to layer
- layer.append(joined);
- } catch (std::logic_error &ex)
- {
- acutPrintf(L"Logic error: %s\n", wstring(ex.what()).c_str());
- } catch (std::runtime_error &ex)
- {
- acutPrintf(L"Runtime error: %s\n", wstring(ex.what()).c_str());
- } catch (std::bad_alloc &ex)
- {
- acutPrintf(L"Allocation error: %s\n", wstring(ex.what()).c_str());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement