更新存根函数
您现在已经修改了该函数。每当修改存根函数时,都应该始终检查以下几点:gp:getDialogInput
在 的情况下,这两个问题的答案都是肯定的。该函数现在接受路径宽度的参数(用于设置默认的图块大小和间距)。现在,该函数的存根版本返回的值不是返回,而是返回包含四个新值的关联列表。gp:getDialogInputTgp:getDialogInput 这两项更改都会影响调用函数的代码和处理函数返回值的代码。将 gpmain.lsp 中以前版本的函数替换为以下代码:C:GPath (defun C:GPath (/ gp_PathData gp_dialogResults)
;; Ask the user for input: first for path location and
;; direction, then for path parameters. Continue only if you
;; have valid input. Store the data in gp_PathData.
(if (setq gp_PathData (gp:getPointInput))
(if (setq gp_dialogResults (gp:getDialogInput (cdr(assoc 40
gp_PathData))))
(progn
;; Now take the results of gp:getPointInput and append this
;; to the added information supplied by gp:getDialogInput.
(setq gp_PathData (append gp_PathData gp_DialogResults))
;; At this point, you have all the input from the user.
;; Draw the outline, storing the resulting polyline
;; "pointer" in the variable called PolylineName.
(setq PolylineName (gp:drawOutline gp_PathData))
) ;_ end of progn
(princ "\nFunction cancelled.")
) ;_ end of if
(princ "\nIncomplete information to draw a boundary.")
) ;_ end of if
(princ) ; exit quietly
) ;_ end of defun
看一下主函数修订版中的粗体线。要使程序正常工作,有两个基本更改:C:GPath
由于替换了存根版本中的占位符,代码中还发生了其他更改。最简单的方法是从在线教程中复制此代码并将其粘贴到您的文件中。 |
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-11-1 08:25
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.