上传者: sacula_ljl
|
上传时间: 2022-02-28 21:14:30
|
文件大小: 51.2MB
|
文件类型: -
1、产品概述
CADViewer+ for iOS是图纸浏览控件在iOS下的SDK,开发者仅需要几行代码即可实现在iOS浏览图纸功能,非常容易集成到应用中。
2、产品功能
CADViewer+ for iOS提供图纸的手指缩放、平移、布局切换、3D视图切换功能,完美支持中文字体和钢筋符号。
3、二次开发介绍
CADViewer+ for iOS支持32位和64位,开发环境要求xcode 6/iOS 8.0以上,请按照下列过程进行iOS集成:
CADViewDemo:示例代码
CADViewerResources.bundle:资源文件
iPhone\CADViewerSDK.framework:设备库,连iPhone/iPad设备用
Simulator\CADViewerSDK.framework:模拟器库,用模拟器用
以下是具体
步骤一:将CADViewerSDK.framework添加到“Emnedded Binaries”
XCode会自动在“Linked Frameworks and Libraries”栏中增加“CADViewerSDK. Framework”库。
步骤二:在” Build Phases”的“Copy Bundle Resources”中添加“CADViewerResources.bundle”
步骤三:注意Framework Search Paths是否正确
完成以上内容,即可进行代码编写:
步骤一:在AppDelegate在完成图纸驱动初始化,这步必须完成,否则后续图纸打开会失败。
#import "AppDelegate.h"
#import
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[CADViewer InitCADViewer]; // 图纸浏览驱动初始化,必须调用
return YES;
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
[CADViewer UninitCADViewer]; // 图纸浏览驱动释放,必须调用
}
步骤二:在浏览视图中调用图纸浏览视图,如下代码:
#import
@interface ViewController : UIViewController
@property(weak, nonatomic) UINavigationController *navContro;
-(IBAction)OpenDwg:(id)sender;
-(IBAction)PushDwg:(id)sender;
@end
#import "ViewController.h"
#import
//弹出视图模式
-(IBAction)OpenDwg:(id)sender
{
NSBundle *bundle = [NSBundle bundleWithURL:[[NSBundle mainBundle] URLForResource:@"CADViewerResources" withExtension:@"bundle"]];
NSString* dwgFile = [[bundle resourcePath] stringByAppendingPathComponent:@"tztest.dwg"];
//NSString* dwgFile = @"test.dwg";
// dwgFile必须是本地的文件,如果是HTTP和FTP文件,请先下载到本地
[CADViewer OpenCADViewer:dwgFile DocName:@"test.dwg" ViewControl:self ];
}
// 导航模式
-(IBAction)PushDwg:(id)sender
{
NSBundle *bundle = [NSBundle bundleWithURL:[[NSBundle mainBundle] URLForResource:@"CADViewerResources" withExtension:@"bundle"]];
NSString* dwgFile = [[bundle resourcePath] stringByAppendingPathComponent:@"tztest.dwg"];
//NSString* dwgFile = @"test.dwg";
// dwgFile必须是本地的文件,如果是HTTP和FTP文件,请先下载到本地
[CADViewer PushCADViewer:dwgFile DocName:@"test.dwg" NavControl: _navContro];