这是圆角偏移的代码&直接键入的圆基本上切出一个或两个步骤F123表示半径为123的圆角。它使用已出错的命令,但查看键入的内容并将其分离,然后执行正确的命令。
代码已修订,请参阅满足要求的进一步发布。 哇,越来越好了!
如果我能得到这个破解,那就太棒了,因为B只是我们所有布里斯班项目的前缀。神秘的
我不是一个Lisp程序的专家,所以如果我通过,你能帮我吗?可能需要一点耐心。。。我对自己的进步感到高兴。
从代码来看,我可能只能使用其中一个wcmatch。。。段落(告诉你我不是编码员!!)用B替换C?
我不知道该如何把这些和我已经拥有的结合起来。但我现在有一点时间来处理这个问题,所以会造成一些Lisp程序的破坏! 你的正确答案是添加“B”,并使一个新的defun名称说“openex”,并使用你的startapp。
如果你看变量com,这将返回项目编号,这是一个有趣的想法,我可能会尝试一下,因为我们的项目基于年份+项目编号2016123
这段代码是从我们公司的lisp库自动加载的,试着用圆角圆等记住小数点是一个“-”f12-5 文字写完了,现在开始!! 不。不知道我在做什么。顺便说一句,出于某种原因,我第一次单击目录的按钮时,它会重复最后一个命令。
在我现有的lisp中是否有不应该出现的空格或“”或\的地方?
(defun jobs ()
(STARTAPP (strcat "EXPLORER /e," "F:\\Jobs"))
)
; Enter the filet radius as part of a command line entry f100 offset O234 circle c123-45
; note - is used for decimal point
; original code and methology by Alan H
; assistance and code that worked by Lee-Mac
; OCT 2015
( (lambda nil
(vl-load-com)
(foreach obj (cdar (vlr-reactors :vlr-command-reactor))
(if (= "openx" (vlr-data obj))
(vlr-remove obj)
)
)
(vlr-command-reactor "openx" '((:vlr-unknowncommand . openx-callback)))
)
)
(defun openx ( obj com )
(setq com (vl-string-translate "-" "." (strcase (car com))))
(cond
( (and
(wcmatch com "~*[~B.0-9]*")
(wcmatch com "B*")
(wcmatch com "~B*B*")
(wcmatch com "~*.*.*")
) ; and
(openx)
)
) ; master cond
) ; defun
(STARTAPP (strcat "EXPLORER /e," "F:\\Jobs\\B16000\\B16007\\Drawings"))
)
(princ) 您需要返回一点您的混合defun,并将openx放入重复的defun中。
我使用的是defun openx和“D”,代码将自动重用D项目编号“123345”等,因此不需要单独的硬编码文件名。你必须有一个严格的目录结构,它才能工作。
( (lambda nil
(vl-load-com)
(foreach obj (cdar (vlr-reactors :vlr-command-reactor))
(if (= "fillet-reactor" (vlr-data obj))
(vlr-remove obj)
)
)
(vlr-command-reactor "fillet-reactor" '((:vlr-unknowncommand . fillet-reactor-callback)))
)
)
; open a project that is 3 directory deep just by project number
; my example c:\2016 projects\2016123\design
(defun openx ( / Proj)
(setq projno (strcat "EXPLORER C:\\" (substr com 2 4) " Projects\\" (substr com 2) "\\Design\\"))
(vla-sendcommand fillet-reactor-acdoc (STARTAPP projno))
)
; calls the fillet command with the radius f123
(defun filletrad ( / rad)
(setq rad (distof (substr com 2) 2))
(if (<= 0.0 rad)
(progn
(setvar 'filletrad rad)
(vla-sendcommand fillet-reactor-acdoc "_.fillet ")
)
)
)
;calls the circle command with radius c123
(defun makecirc ( / rad radd)
(setq rad (distof (substr com 2) 2))
(if (<= 0.0 rad)
(progn
(setvar 'circlerad rad)
(setq pt (getpoint "Pick centre pt"))
(vla-sendcommand fillet-reactor-acdoc "_.Circle !pt")
)
)
)
;calls offset with a distance + or - for left and right O123
(defun offdist ( / dist)
(setq dist (distof (substr com 2) 2))
(if (<= 0.0 dist)
(progn
(setvar 'offsetdist dist)
(vla-sendcommand fillet-reactor-acdoc "_.Offset")
)
)
)
; calls a lisp program
(defun pipeoff ( / dist)
(setq dist (distof (substr com 2) 2))
(if (<= 0.0 dist)
(progn
(setq poff (strcat "P" (rtos dist 2 0)))
(if (not poff)(load "Pipe offsets"))
(vla-sendcommand fillet-reactor-acdoc poff)
)
)
)
; start of call back F O P D as 1st character
(defun fillet-reactor-callback ( obj com )
(setq com (vl-string-translate "-" "." (strcase (car com))))
(cond
; open explorer
((and
(wcmatch com "~*[~D.0-9]*")
(wcmatch com "D*")
(wcmatch com "~D*D*")
(wcmatch com "~*.*.*")
) ; and
(openx)
)
; fillet
( (and
(wcmatch com "~*[~F.0-9]*")
(wcmatch com "F*")
(wcmatch com "~F*F*")
(wcmatch com "~*.*.*")
) ; and
(filletrad)
)
; circle
((and
(wcmatch com "~*[~C.0-9]*")
(wcmatch com "C*")
(wcmatch com "~C*C*")
(wcmatch com "~*.*.*")
) ;and
(makecirc)
)
; offset
((and
(wcmatch com "~*[~O.0-9]*")
(wcmatch com "O*")
(wcmatch com "~O*O*")
(wcmatch com "~*.*.*")
) ; and
(offdist)
)
; pipe
((and
(wcmatch com "~*[~P.0-9]*")
(wcmatch com "P*")
(wcmatch com "~P*P*")
(wcmatch com "~*.*.*")
) ; and
(pipeoff)
)
) ; master cond
) ; defun
到
^C^C(startapp "explorer" (findfile "Drawing Register.xlsm"))
在一场令人惊讶的无知秀中。。。
哦,好吧。。。试一试!!至少我不是一个什么都没做的人嘿?! ^C^C(startapp "explorer" (findfolder "PDF"))
(findfile "pdf")
哈哈。。。非常感谢Roy!
(再靠近一点就会咬到我?!)
ha ha... thanks very much Roy!
(any closer it would've bitten me?!)
页:
1
[2]