明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: print1985

[资源] 另类:带捕捉、正交、极轴的grread函数--.NET测试版V1.0--8月28更新

    [复制链接]
发表于 2021-9-21 16:39 | 显示全部楼层
大佬学习了~~~
发表于 2021-9-21 16:40 | 显示全部楼层
请教大佬下面这个,复制的时候该如何实现拖动效果呢
、(defun c:tt5(/ oce ss p1 p2)
   (setq n1 10)
   (defun *error* (msg)
     (if ss (sshighlight ss 4)) ;取消亮显
    (SSSETFIRST NIL)
     (princ "error:")
     (princ msg)
   )
(setq oce(getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq ss (ssget))
    (if (< (sslength ss) n1)  (SSSETFIRST NIL SS))
    (sshighlight ss 3)
(if (null ss) (exit))
(setq p0(getpoint"\n指定基点:"))
(setq p2 p0)
(if (null p0 )(exit))
(princ "\n指定第二点或位移:")
(while t
(setq p1(getpoint p0))
(setq ent (entlast))
(if (null p1) (mosi11) (mosi12))
(setq tempss ss)
(setq ss (entbackss ent))
(setq p2 (getvar "lastpoint"))
    (vl-cmdf ".copy" ss "")
   (command)
    (command "select" ss "")
      (sshighlight ss 3)
)      
(princ)
)
(defun mosi12()
(vl-cmdf ".copy" ss "" p2 p1 )
(setq juli (distance p0 p1))
(setq  x0 (car p0))
(setq  y0 (cadr p0))
(setq p0 p1)
(setq  x1 (car p1))
(setq  y1 (cadr p1))
(setq  x (- x1 x0))
(setq  y (- y1 y0))
(setq   hudu(atan y x) )
(setq  x1 (+ x0 x))
(setq  y1 (+ y0 y))
(setq  p1 (list x1 y1 0.0))
(princ (strcat "\n指定下一点或继续位移<" (rtos juli ) ">:"))
)
(defun mosi11()
        (setq p1 (list (+ (nth 0 p0) (* juli (cos hudu)))
                       (+ (nth 1 p0) (* juli (sin hudu)))
                       (nth 2 p0)
                 )
        )
(vl-cmdf ".copy" ss "" p2 p1 )
(setq juli (distance p0 p1))
(setq p0 p1)
(princ (strcat "\n指定下一点或继续位移<" (rtos juli ) ">:"))
)
发表于 2021-9-23 00:37 | 显示全部楼层
有一个问题能改进就更好了,就是在正交模式下移动实体时,实体并不沿着坐标轴的方向移动,而是随着光标的位置移动,当然最终的结果还是返回坐标轴上的点,但是移动的过程看着很别扭。

点评

收到 多谢反馈  发表于 2021-9-24 13:31
发表于 2021-9-25 14:38 | 显示全部楼层
无法加载程序集。错误详细信息: System.IO.FileLoadException: 未能加载文件或程序集“file:///D:\Software\tmp\grread.dll”或它的某一个依赖项。不支持操作。 (异常来自 HRESULT:0x80131515)
文件名:“file:///D:\Software\tmp\grread.dll” ---> System.NotSupportedException: 尝试从一个网络位置加载程序集,在早期版本的 .NET Framework 中,这会导致对该程序集进行沙盒处理。此发行版的 .NET Framework 默认情况下不启用 CAS 策略,因此,此加载可能会很危险。如果此加载不是要对程序集进行沙盒处理,请启用 loadFromRemoteSources 开关。有关详细信息,请参见 http://go.microsoft.com/fwlink/?LinkId=155569
   在 System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   在 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   在 System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   在 System.Reflection.Assembly.LoadFrom(String assemblyFile)
   在 Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
   在 loadmgd()


命令: loadFromRemoteSources
未知命令“LOADFROMREMOTESOURCES”。按 F1 查看帮助。

Cad2016 加载就这样 楼主看看是什么问题

点评

试试:1、右键-属性-常规 解除锁定 2、放到cad支持目录 3、dll文件取得管理员权限  发表于 2021-9-29 11:17
发表于 2021-10-27 14:29 | 显示全部楼层
看着很NB,就是不会用,先标记一下,
回复 支持 0 反对 1

使用道具 举报

发表于 2021-12-2 02:00 | 显示全部楼层
半夜茶醒,浏览了下,相当牛逼。给甘蔗点个赞

点评

波总 半夜惊魂啊  发表于 2021-12-2 12:39
回复 支持 0 反对 1

使用道具 举报

发表于 2021-12-6 20:29 | 显示全部楼层
caoyin 发表于 2021-8-20 13:59
很久没来,一打开网页就看见大神的帖子,膜拜
以前一直用老毛子的ARX程序——DynDraw,跟楼主的功能 ...

c版你好啊。

点评

老朋友了,你好啊  发表于 2022-3-13 21:33
发表于 2022-2-12 15:12 | 显示全部楼层
双CAD同步对图 能否告知下怎么用?谢谢.
发表于 2022-7-30 13:43 | 显示全部楼层
厉害厉害   支持大佬!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-25 09:23 , Processed in 2.204067 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表