乐筑天下

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

[编程交流] Working Point Lisp, skips a li

[复制链接]

4

主题

8

帖子

4

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-5 16:38:32 | 显示全部楼层 |阅读模式
Hello,
 
I have more or less completed this little lisp and I can't figure out why it is skipping the first line after my 'if' statement.
 
Basically, when you're in paperspace, it'll put your cursor into modelspace and you pick the point you want to annotate with a working point. For some reason my lisp won't go into modelspace.
 
  1. ;; This lisp creates a working point leader in paperspace;; known bugs: the current selected multileader type will be the style of the working point;; Rev 1 2017-03-02;; Created by J. Therrien(defun c:WorkingPoint (/ WorkingPoint Easting Northing Point PSPACEPOINT PSPACE TEXT TEXTPROPS COORD NorthingWP EastingWp) (if (and (= (getvar "TILEMODE") 0) (= (getvar "CVPORT") 1))   (;;then    (command      "_.mspace"      );;end command     (setq WorkingPoint (getpoint "\nWhere is Working Point?: "))     (setq Northing (rtos (cadr WorkingPoint) 2 1));;set "y" value of WorkingPoint to Northing     (setq Easting (rtos (car WorkingPoint) 2 1));;set "x" value of WorkingPoint to Easting     (setq NorthingWP (strcat "N: " Northing));; creates the proper formatting for the leader     (setq EastingWP (strcat "E: " Easting));; creates the proper formatting for the leader     (command "_.point" WorkingPoint);;end command     (setq point (entlast));;set the workingpoint to point     (command "_.chspace" point "" "");;this brings the workingpoint set in the modelspace to paperspace     (setq pspacepoint (entget point));;get the properties for point     (setq pspace (cdr (assoc 10 pspacepoint)));;find the x&y coords and set to pspace     (setq anotbp (getpoint "\nSpecify leader basepoint: "))     (COMMAND"mTEXT" PSPACE "@30,-30" "WORKING POINT" NORTHINGWP EASTINGWP "");;end command     (setq text (entlast));;set mtext to variable text     (setq textprops (entget text));;get the properties from text     (setq coord (cdr (assoc 1 textprops)));;find the string properties and set to coord     (command"_.mleader" pspace anotbp coord"_.erase" point text "");;END COMMAND     );;end then   (alert "Make sure you are in paperspace to use this command");;else   );;end if );;end defun
回复

使用道具 举报

18

主题

1529

帖子

973

银币

中流砥柱

Rank: 25

铜币
649
发表于 2022-7-5 17:13:07 | 显示全部楼层
Use progn.
回复

使用道具 举报

4

主题

8

帖子

4

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-5 18:02:23 | 显示全部楼层
wow... that was dumb on my part, thanks!
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-13 12:50 , Processed in 0.581664 second(s), 58 queries .

© 2020-2025 乐筑天下

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