mbrandt5 发表于 2015-10-1 21:46:21

用于计算两个线性参数的柴油表达式

我正在寻找使用柴油表达式来评估线性参数并显示两个参数中较大的一个...
我所能想出的就是这个,我确信是错误的...
$(
, $(>, 距离1,距离2))
任何指针都将不胜感激
**** Hidden Message *****

mjfarrell 发表于 2015-10-2 09:45:36

有趣的是,到底需要什么样的最终状态
也许可以通过其他方式进行此“评估”?

Master_Shake 发表于 2015-10-2 10:15:33


它不起作用吗?

Master_Shake 发表于 2015-10-2 10:31:37

据我所知,您不能将字段表达式嵌套在DIESEL表达式中,因此,除非您将线性参数的值分配给用户系统变量,否则您将无法从DIESEL表达式中引用这些值。
另一种方法是使用公式字段(AcExr),但是,它们不支持条件并且没有最小/最大公式函数。

mbrandt5 发表于 2015-10-2 10:49:55

BricsCAD在这方面和AutoCAD有区别吗?

mjfarrell 发表于 2015-10-2 10:53:11

我希望它在动态块上的attdef中工作...
最终结果是一个属性定义,显示两个值中较大的值
根据Lee Mac所说,不可能将字段值直接放入柴油表达式中
如果有人知道,另一个问题是您可以在柴油表达式中使用vlax来引入参数值吗?
还有一个问题是您可以使用lisp引用参数值,然后将lisp值显示在柴油表达式中吗?
Lee Mac还知道如何将系统变量值分配给字段值吗?

mbrandt5 发表于 2015-10-2 11:47:52

我还是不明白你在找什么
也许图片会有帮助…
如果是距离值,为什么不使用不可见(可视状态)元素来获得该距离。。。

mbrandt5 发表于 2015-10-2 12:34:29


(defun get-or-make-Xrecord (/ anXrec)
;Defines mainDict
(Setq mainDict (namedobjdict))
;Defines Entity LineOne
;Not Sure How To Do This Assuming Handent DictSearch and NentSel
(Setq LineOne (...))
;Defines Entity LineTwo
;Not Sure How To Do This Assuming Handent DictSearch and NentSel
(Setq LineTwo (...))
;Defines LongestLine
(Setq longLine ((max ("LineOne" "LineTwo"))))
(setq mainDict (namedobjdict))
   (cond

       ;;if "OUR_DICT" is now valid then look for "OUR_VARS" Xrecord
       ((not (setq anXrec (dictsearch maindict "OUR_VARS")))

      ;;if "OUR_VARS" was not found then create it
        ;;NOT SURE HOW TO APPLY TEXT CHARACTERS
      (setq anXrec (entmakex '((0 . "XRECORD")
                              (100 . "AcDbXrecord")
                              (7 . "Arial")
                              (8 . "A09--T-")
                              (40 . 2.0)
                              (? . ?))
                     )
      )

      ;;if creation succeeded then add it to our dictionary
      (if anXrec (setq anXrec (dictadd maindict "OUR_VARS" anXrec)))
      )

       ;;if it's already present then just return its entity name
       (setq anXrec

      (cdr (assoc -1 (dictsearch maindict "OUR_VARS")))
       )
   )
)
;(defun c:subent ()
(while   
   (setq Ent (entsel "\nPick an entity: "))
   (print (strcat "Entity handle is: "
          (cdr (assoc 5 (entget (car Ent))))))
   )
   (while   
      (setq Ent (nentsel "\nPick an entity or subEntity: "))
      (print (strcat "Entity or subEntity handle is:"
          (cdr (assoc 5 (entget (car Ent))))))
   )
(prompt "\nDone.")
(princ)
)
;Returns Entity handle
;(handent "XXX") Returns entity name based on handle

我算出了sslength/getlength来确定lineone/linetwo。仍然不确定如何将这些信息作为实体变量输入到新创建的xrecord中...
我也不确定Max函数是否评估类...
非常感谢任何指示、参考资料或帮助
页: [1]
查看完整版本: 用于计算两个线性参数的柴油表达式