Autocad samples
Suggested code sample
Section titled “Suggested code sample”First, you must create the webservice object:
OKMWebservices ws = OKMWebservicesFactory.newInstance(host);Then should login using the method “login”. You can access the “login” method from webservice object “ws” as is shown below:
ws.login(user, password);At this point you can use all the Activity methods from “autocad” class as is shown below:
List<XRef> xrefList = ws.autocad.getXrefs("1be884f4-5758-4985-94d1-f18bfe004db8");Methods
Section titled “ Methods”getXrefs
Section titled “getXrefs”Description:
| Method | Return values | Description |
|---|---|---|
| getXRefs(String uuid) | List |
Returns a list of the document references of an Autocad document. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;
namespace OKMRest{public class Program{static void Main(string[] args){String host = "http://localhost:8180/openkm";String username = "okmAdmin";String password = "admin";OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try{ws.login(user, password);foreach (XRef xRef in ws.autocad.getXrefs("5ce6dd37-7472-404a-878e-274005a2d6db")){Console.WriteLine(xRef.toString());}}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}refresh
Section titled “refresh”Description:
| Method | Return values | Description |
|---|---|---|
| refresh(String uuid) | void | Refresh references of an Autocad document. |
Example:
using System;using System.Collections.Generic;using System.Linq;using System.Text;using com.openkm.sdk4csharp;using com.openkm.sdk4csharp.bean;using com.openkm.sdk4csharp.impl;
namespace OKMRest{public class Program{static void Main(string[] args){String host = "http://localhost:8180/openkm";String username = "okmAdmin";String password = "admin";OKMWebservice ws = OKMWebservicesFactory.newInstance(host);
try{ws.login(user, password);ws.autocad.refresh("5ce6dd37-7472-404a-878e-274005a2d6db");}catch (Exception e){System.Console.WriteLine(e.ToString());}}}}