Peri 发表于 2022-7-6 09:29:20

LISP中的缩放灵敏度

你好
我刚开始写LISP的,已经为我的工作室准备了一些。只是为了在潮水低潮时保持忙碌。
最后一个我几乎完成的是一个按顺序偏移的偏移lisp(我真的不在乎是否已经为这个制作了lisp,我一直在尝试我的lisp例程制作)。我首先选择偏移量,然后是每个偏移量的值,最后是要偏移的边。
我的问题是,当我放大到直线附近时,lisp效果很好——我的意思是,它偏移了我输入的valeus。但当我在缩放上有点远时,它会偏移到不同的值。我真的不知道它为什么这么做。我需要调整缩放灵敏度吗?有这样的事吗?
 
这是我写的代码(葡萄牙语)。不要介意它的脏乱。
谢谢
 
;Criado por Rodrigo Líbano


(defun c:offseq (/ numof numof2 numof3 list carl carls carlss voffx vof2x vof1x p2x side)

   (initget 7)
   (setq numof (getint "\nNúmero de offsets :"))
   (initget 7)
   (setq voffx (getdist "\nValor do primeiro offset:"))
   (setq numof (- numof 1))
   (setq numof2 numof)
   (setq numof3 numof)
   (setq list (cons voffx voffx))
   (setq vof1x voffx)
   (while numof   
       (initget 7)
       (setq vof2x (getdist (strcat "\nValor do próximo offset :")))
       (setq vof2x (+ vof2x vof1x))
       (setq list (cons vof2x list))
       (setq vof1x vof2x)
       (setq numof (1- numof))
       (if (= numof 0)
         (setq numof nil)
         (setq numof numof)
       )
   ); end while
   (princ list)
   (setq carlss carls)
   (while
       (setq p2x (cadr (entsel "\nSelecione Objeto:")))
       (setq side (getpoint "\nSelecione lado:"))
       (while numof2      
         (setq carl (nth numof2 list))
         (if (= numof2 numof3)
               (setq carls (- carl carl))
               (setq carls (nth (+ numof2 1) list))
         ); end if
         (setq carls (- carl carls))
         (setvar "OFFSETDIST" carl)
         (command "._UNDO" "_GROUP")
         (command ".OFFSET" carl p2x side "")
         
         (if (= numof2 0)
               (setq numof2 nil)
               (setq numof2 (- numof2 1))
         ); end if
       ); end while
       (setq numof2 numof3)
       (setq carl carlss)
   ); end while

   
   (princ)
)
      

Tharwat 发表于 2022-7-6 09:50:14

首先,不能使用函数作为变量的名称。
 
 
我会查一下你的密码,看看能不能帮你。

Peri 发表于 2022-7-6 09:55:20

 
 
有趣的是,尽管如此,这个惯例还是奏效了。不过,我想看看这是否是问题所在,但事实并非如此。
提供有关该问题的更多信息。假设我向lisp询问3个偏移量,值1、2和3。(lisp所做的实际上是偏移相同的原始行,因此值更改为1、3和6,使行之间的间隔与输入值保持一致)。
当放大时,线之间的距离是正确的(1,2,3),但当重试稍微缩小时,我得到的距离是1,3和6。
 
它可能与pickbox变量有关吗?(我真的不明白这一点,但在另一个Lisp程序的地方找到了一些关于它的东西)。
 
谢谢

Tharwat 发表于 2022-7-6 10:09:15

 
这并不好笑,这是你应该关心的事实。

Peri 发表于 2022-7-6 10:20:02

谢谢你的提示,已经处理好了,但问题仍然存在。我不是想成为一个聪明的***。

BIGAL 发表于 2022-7-6 10:30:26

我在更改捕捉模式之前遇到过这个问题,有时将其设置为0可以工作,我的解决方法是缩放到某个比例,使对象在对其进行操作之前可见,然后跳回原来的比例。这是一个墙清理Lisp程序的情况,如果你放大到远处,将无法工作,将拾取错误的线放大一点,每次都可以完美地工作。你会发现一些没有记录的小错误。为Intellicad、MAC acad编写的代码,必须根据运行的版本更改工作代码。
页: [1]
查看完整版本: LISP中的缩放灵敏度