Tharwat 发表于 2022-7-5 23:54:20

希望有人可以尝试代码并告诉我们结果

mdbdesign 发表于 2022-7-5 23:57:02

在我这边工作。

Tharwat 发表于 2022-7-6 00:00:19

谢谢你,马瑞克

mdbdesign 发表于 2022-7-6 00:02:46

没问题,随时可以。
我没有Camtasia,你能加上弧下的眼睛会看起来像眨眼。。。

Tharwat 发表于 2022-7-6 00:06:45

你指的是什么?我没弄明白

Wojciech 发表于 2022-7-6 00:09:26

没有错误。是的,我肯定。1.5我设置为默认值。缩放正确。线路长度为100。
 
Command: test
Specify point at the End Side of Polyline :
Specify Offset distance < 1.5 > :
Command:
 
附:但第一次,它起作用了。。。现在,它在Autocad中的任何文件中都不起作用。。另一个LISP正确地工作

mdbdesign 发表于 2022-7-6 00:12:56

Ej,Wojtek cos namieszales。。。
塔瓦,眨着眼睛。。。。

Wojciech 发表于 2022-7-6 00:15:22

好的,好的,我知道问题出在哪里。。在脚本的第一个开头,我不能在“指定偏移距离”之后单击enter键,但我必须输入自己的数字。。。。。。。。
 
Tharwat,你能把“指定偏移距离”放在代码中,而不把“指定偏移距离”放在Autocad中吗?现在没有必要这样做,这就产生了这个问题。
 
欢迎塔瓦和波兹德罗维尼亚·德拉·马尔卡

prodromosm 发表于 2022-7-6 00:19:11

我在这个网站上找到了这个lisp
 
(defun C:SLOPE-LINE (/ Talud_bovenTalud_onder afstand afstand_totaal count p1 p2 kleur)

(defun IS-ON-PL? (ENAME PKT /)
   (vl-catch-all-apply
   'vlax-curve-getdistatpoint
   (list
       ENAME
       PKT
       ) ;_ end of list
   ) ;_ end of vlax-curve-getDistAtPoint
   PKT
   ) ;_ end defun

(vl-load-com)


(if (and (setq Talud_boven (car (entsel "\nSelect top slope: ")))
          (setq Talud_onder (car (entsel "\nSelect bottom slope: ")))
          (setq afstand (getint "\nLine slope distance:"))
          (setq kleur (acad_colordlg )
          ) ;_ end of and
   
   (progn
   (setq afstand_totaal 0)
   (setq count 0)
   (setq p1 (vlax-curve-getStartPoint
                (vlax-ename->vla-object Talud_boven)
                ) ;_ end of vlax-curve-getStartPoint
         ) ;_ end of setq
   (while p1
       (if (equal (/ count 2.0) (fix (/ count 2.0)) 0.001)
         (setq p2
                (vlax-curve-getClosestPointTo
                  (vlax-ename->vla-object Talud_onder)
                  p1
                  ) ;_ end of vlax-curve-getClosestPointTo
               ) ;_ end of setq
         (setq
         p2 (MAPCAR '(LAMBDA (x) (/ x 2))
                      (MAPCAR '+
                              p1
                              (vlax-curve-getClosestPointTo
                              (vlax-ename->vla-object Talud_onder)
                              p1
                              ) ;_ end of vlax-curve-getClosestPointTo
                              ) ;_ end of MAPCAR
                      ) ;_ end of MAPCAR
         ) ;_ end of setq
         ) ;_ end of if
       (entmake
         (list '(0 . "LINE")
               (cons 10 p1)
               (cons 11 p2)
               ;'(62 . 1) ; standaard kleur
               (cons 62 kleur) ; kleur dia dialog instellen

         ) ;_ end of list
       ) ;_ end of entmake
       (if
         (setq p1 (IS-ON-PL?
                  (vlax-ename->vla-object Talud_boven)
                  (vlax-curve-getpointatdist
                      (vlax-ename->vla-object Talud_boven)
                      (setq afstand_totaal (+ afstand_totaal afstand))
                      ) ;_ end of vlax-curve-getpointatdist
                  ) ;_ end of IS-ON-PL?
               ) ;_ end of setq
          p1
          ) ;_ end of if
       (setq count (1+ count))
       ) ;_ end of while
   ) ;_ end of progn
   ) ;_ end of if
) ;_ end of defun

Wojciech 发表于 2022-7-6 00:23:26

我发现了一个奇怪的问题。某些行上的脚本不起作用。
Command: test
Specify point at the End Side of Polyline :
Specify Offset distance < 1.5 > :
Error: bad argument type: numberp: nil
Command:

 
链接到DWG:
http://ftp.feniksg.unixstorm.org/wczyszczona_mapa.dwg
 
塔尔瓦特。当您试图修复该问题时,请从命令行中删除“指定偏移距离”,并将其放入代码中。
 
将其指定为代码,如$variable=1.5
 
编辑:脚本不使用“行”?
页: 1 [2]
查看完整版本: 像smart off之类的东西