乐筑天下

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

[综合讨论] Draw shape, and have it automa

[复制链接]

24

主题

109

帖子

85

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2022-7-6 23:43:31 | 显示全部楼层 |阅读模式
Hi all, I was wondering if someone has a script that does the following:
 
 
I want to be able to draw a column or wall in plan (rectangle, square or circular) and have the column or wall automatically hatched, with two different hatches on two different layers (one will be a solid hatch to denote this is a support on the floor over, and one will be a cross hatch to denote it occurs on the current floor)
 
 
Can anyone help me out please?
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-7 00:11:38 | 显示全部楼层
This will do two in one pick you can add it to another command that you have created but it can not be say random pline then auto hatch, the other method is to pick object then hatch twice.
 
  1. (defun c:BHH ( / pt)(setq pt (getpoint "\nPick internal point"))(setvar "hpname" "ansi31")(setvar "hpscale" 1.0)(setvar "clayer" "layer1")(command "-bhatch" pt "")(setvar "clayer" "layer2")(setvar "hpname" "ansi32")(setvar "hpscale" 2.0)(command "-bhatch" pt ""))(c:BHH)(defun c:BHO ( / obj)(setq obj entlast) ; must be used after drawing object else will hatch wrong object use entsel for any time.(setvar "hpname" "ansi31")(setvar "hpscale" 1.0)(setvar "clayer" "layer1")(command "-hatch" "S" obj "" "")(setvar "clayer" "layer2")(setvar "hpname" "ansi32")(setvar "hpscale" 2.0)(command "-hatch" "s" obj "" ""))(c:BHO)
回复

使用道具 举报

24

主题

109

帖子

85

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
120
发表于 2022-7-7 00:29:39 | 显示全部楼层
Thanks BigAl, Half way there to what I wanted  A couple of items that might help me further (if I can't get the hatch to appear after drawing a shape). For this lisp to work, I need to have the two layers that the hatch are to appear on already in the drawing. Is it possible for the lisp to create the layers if they are not already present in the drawing? Currently the code puts the hatches on "layer1" and "layer2" however if they are not already in the drawing, the lisp doesn't work.
 
 
And something even harder, can the lisp read what layer I currently have active, and then create a layer named similar to what I have active? For example, if my current layer name = Col Level 1, then one hatch will create a layer called Col Level 1 Hatch over, and the other hatch will create a layer called Col Level 1 Hatch Under?
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-7 01:01:10 | 显示全部楼层
If you do some searching into retrieving the layer table then you can do both what you want check it exists  or create a layer based on current layer name which is the variable CLAYER.
 
If you write your own draw a shape command then hatch can appear twice.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-9 21:07 , Processed in 0.512434 second(s), 60 queries .

© 2020-2025 乐筑天下

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