Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
-(IBAction)onClosePressed:(id)sender
{
    ...
    [[CFxARESInstance instance] runCommand:@"_CLOSE\n"];
}

DWG Viewer - Change viewing modes

Status
titleOBJ-C

It is not necessary to implement viewing gestures. The framework comes with a set of basic finger gestures to change the active view of the drawing. It supports zooming in and out but has to know if it runs in Pan or Orbit mode. The viewing mode can be switched with a Diesel expression that can be executed with the runCommand method of the singleton [CFxARESInstance instance].

 

File: ViewController.m

Code Block
languageobjective-c
-(void)SwitchViewModeToPan:(BOOL)panMode
{
    if (m_bPanMode != panMode)
    {
        m_bPanMode = panMode;
        ...
        [[CFxARESInstance instance] runCommand:@"'2dmode $M=$(if,$(and,$(getvar,2dmode),1),$(-,$(getvar,2dmode),1),$(+,$(getvar,2dmode),1))"];
    }
}


Note:  The kernel SDK also provides commands like ZOOM or PAN to achieve similar results.