乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 33|回复: 4

[编程交流] Combining two LISP Routines -

[复制链接]

15

主题

64

帖子

49

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
75
发表于 2022-7-5 18:11:54 | 显示全部楼层 |阅读模式
Hi everyone,
 
I have a drawing with a ton of leaders and text received from an outside source. I need to change the drawing orientation to a different rotation. By doing this all the text is obviously rotated to a different orientation.
 
I am trying to take all the leaders and text and combine them into mleaders, I can do this using LeaderToMleader.lsp and it works great. What I am trying to add to it is a another LISP that then rotates the mtext based on the snap angle. This LISP also works, but what I really want to do is combine the two.
 
As of now I have to run one then the other. Ideally I would like to combine them into one LISP. I have tried many different things but not matter what I do I always end up with an error stating too many arguments.
 
Can anyone help? The LISPs are below...
 
  1. ;;; CADALYST 08/08  www.cadalyst.com/code ;;; Tip 2305: LeaderToMleader.lsp        Leader to Multileader        (c) 2008 Lyle Hardin ;;; Pick an old style leader and text to create a new mleader entity and erase the old leader and text.;;; March/2008(defun c:leadertomleader () (setq        leader        (entsel "\nPick Leader")        ; pick leaderleader2        (entget (car leader))pt1        (dxf 10 leader2)                ; get first point of leaderlayer         (dxf 8 leader2)                        ; get layer of leadermtext        (entsel "\nPick Text")        ; pick textmtext2        (entget (car mtext))pt2        (dxf 10 mtext2)                ; get point of texttext        (dxf 1 mtext2)                ; get  )                                        ; setq  (command "-layer" "s" layer "")        ; set layer of leader picked to current (command "mleader" pt1 pt2 text)        ; start mleader command (COMMAND "ERASE" mtext "")                ; erase text picked (command "erase" leader "")                ; erase leader picked)                                        ; defun(defun dxf(code elist)                ; define dxf function (cdr (assoc code elist))     ;Finds the association pair, strips 1st element);defun
 
  1. (defun c:MLRO (/ ss ang i sset)(vl-load-com)(defun *error*()  (setvar "nomutt" 0) ) (if   (and(progn        (setvar "nomutt" 1)        (setq ss (ssget '((0 . "MULTILEADER"))))        (setvar "nomutt" 0)        (princ))(setq ang (getvar "snapang"))   )    (repeat      (setq i (sslength ss))       (setq sset (ssname ss (setq i (1- i))))       (vla-put-TextRotation (vlax-ename->vla-object sset) ang)    )    (princ) ) (princ))
回复

使用道具 举报

15

主题

64

帖子

49

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
75
发表于 2022-7-5 18:39:39 | 显示全部楼层
No one huh?  I am really stumped on this one, any help would be greatly appreciated.
 
Thanks in advance...
回复

使用道具 举报

95

主题

477

帖子

383

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
475
发表于 2022-7-5 18:42:15 | 显示全部楼层
I would just add the L filter with ssget and then put the code after your create the multileader. Ie:
  1. (setq ss (ssget "_L"))
instead of
  1. (setq ss (ssget '((0 . "MULTILEADER))))
回复

使用道具 举报

15

主题

64

帖子

49

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
75
发表于 2022-7-5 19:11:21 | 显示全部楼层
So I did your suggestion and it seems to be working. I swear I tried that already, very strange. But thank you very much!!
回复

使用道具 举报

95

主题

477

帖子

383

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
475
发表于 2022-7-5 19:15:30 | 显示全部楼层
No worries, I'm glad I could help.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-12 19:32 , Processed in 0.691897 second(s), 62 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表