//https://blog.csdn.net/qq_21489689/article/details/78973787
[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("accore.dll", EntryPoint = "acedPutSym",
CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
extern static private int acedPutSym(string args, IntPtr result); /// <summary>
/// Set a LISP variable value.
/// </summary>
/// <param name="name">The variable name.</param>
/// <param name="rb">The variable value</param>
public static void SetLispSym(string name, ResultBuffer rb)
{
acedPutSym(name, rb.UnmanagedObject);
} [System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("accore.dll", EntryPoint = "acedGetSym",
CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
extern static private int acedGetSym(string args, out IntPtr result); /// <summary>
/// Get a LISP variable value.
/// </summary>
/// <param name="name">The variable name.</param>
/// <returns>The variable value or null if failed.</returns>
public static ResultBuffer GetLispSym(string name)
{
IntPtr ip = IntPtr.Zero;
int status = acedGetSym(name, out ip);
if (status == (int)PromptStatus.OK && ip != IntPtr.Zero)
{
return ResultBuffer.Create(ip, true);
}
return null;
}
//当然,要读取这个变量,首先要设置或者加载这个变量
ResultBuffer rb1114c = GetLispSym("dydj");
float intRetio=;
foreach (TypedValue val in (System.Collections.IEnumerable)rb1114c)
{
intRetio = (float)Convert.ToDouble((val.Value.ToString()));//根据你设置的类型进行转换
}

最新文章

  1. console 输出信息美化
  2. sessionStorage/localStorage 本地存储
  3. FZU xxx游戏(拓扑排序+暴力)
  4. NSArray block用法
  5. hdu 3790 (最短路径问题dijkstra)
  6. Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: &quot;((()))&quot;, &quot;(()())&quot;, &quot;(())()&quot;, &quot;()(())&quot;, &quot;()()()&quot;
  7. C#线程安全使用(五)
  8. __name__的意义与作用
  9. Python技术之书籍汇总
  10. 【SRM-06 D】五色战队&amp;&amp;【codeforces 788E】 New task
  11. tensorflow/core/kernels/conv_ops.cc:659] check failed: stream-&gt;parent()-&gt;getc
  12. Java:多个文档合并输出到一个文档
  13. leetcode1004
  14. CUDA C Programming Guide 在线教程学习笔记 Part 3
  15. Android开发学习之3大类菜单
  16. 爬虫6:pyquery库
  17. 【Network Architecture】Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning(转)
  18. 【转】 Pro Android学习笔记(九十):了解Handler(4):Worker线程
  19. [POJ1637]混合图的欧拉回路判定|网络流
  20. ios调用Html内JS alert 不能点击关闭为甚?

热门文章

  1. Spark 中的机器学习库及示例
  2. android_sdcard读写(二)
  3. JAVA面试题 手写ArrayList的实现,在笔试中过关斩将?
  4. RDIFramework.NET框架基于Quartz.Net实现任务调度详解及效果展示
  5. ASP.NET Core系列(二):创建第一个.Net Core 项目
  6. Java调用方法参数究竟是传值还是传址?
  7. RabbitMQ从入门到精通(三)
  8. 跟着大彬读源码 - Redis 6 - 对象和数据类型(下)
  9. iOS 图解弹幕功能的实现
  10. 《VR入门系列教程》之2---VR头显