乐筑天下

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

[编程交流] New to AUtoLISP, trying to ins

[复制链接]

1

主题

1

帖子

0

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-5 22:36:59 | 显示全部楼层 |阅读模式
Hello,
 
I'm very new to Autolisp, and I am having some trouble with my code. Here's a description of what I am trying to do:
 
I have a drawing consisting of two pipes, bottom pipe and upper pipe. They will be inclined in reference to the paper, represented by the square. I need to insert at the end of these pipes a block (inside the block will be a leader), which then will be rotated to align itself with the paper orientation.
Somehow, the code i've written so far is not working, I believe it's because i'm not getting the correct syntax of the commands i'm using. Would anyone be willing to take a look? Help is much appreciated.
 
See attached files for my code and the drawing (containg the desired block)
ttten.LSP
Drawing1.dwg
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

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

铜币
358
发表于 2022-7-5 23:13:39 | 显示全部楼层
Welcome to CADTutor .
 
Suppose that you know the rotation angle and it is assigned to variable rot in the following example .
 
  1. (if (and (tblsearch "BLOCK" "test2")        (setq rot 45.0)        (setq p (getpoint "\n Specify insertion point :"))   ) (command "_.-insert" "test2" "_non" p "1" "1" rot))
回复

使用道具 举报

1

主题

80

帖子

79

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-5 23:23:43 | 显示全部楼层
Under ;Calculations
You have not set anything for angpt uppercurvepoint or bottomcurvepoint. Move your defuns above this section.
 
Additionally, I would be more apt to use an entmod.
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-5 23:44:15 | 显示全部楼层
Be careful to that if you change the units accidently setting rot to 45 is what degrees or radians look into the setvars before doing angles
 
  1. (SETVAR "LUNITS" 2)(SETVAR "ANGBASE" 0.0)(SETVAR "ANGDIR" 0)(SETVAR "LUPREC" 0)(SETVAR "AUNITS" 0)(SETVAR "AUPREC" 0)
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-11 06:37 , Processed in 0.474261 second(s), 60 queries .

© 2020-2025 乐筑天下

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