乐筑天下

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

[编程交流] HVAC图纸

[复制链接]

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 12:50:21 | 显示全部楼层
Viv,
 
I just modify the code for a strange problem. I reposted the zip file.
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 12:53:05 | 显示全部楼层
Sorry about this Viv,
 
I found out what was wrong, I needed to convert a real to a string a second time in the program. It was all out of sync. This version works the way it is suppose to.
 
 
Here is the corrected change.
  1.   (setq INPT (getpoint "\nSpecify insertion point: "))                      ;Set INPT ~ Insertion Point (setq GWID  G:WID)                                                        ;Set GWID  ~ Grille Width   (Real) [color=red](setq GWID$ (rtos GWID 2 0))                                              ;Set GWID$ ~ Grille Width[/color]   (String) (setq FDIR$ F:DIR$)                                                       ;Set FDIR$ ~ Flow Direction (String) (setq FWID (+ GWID 50))                                                   ;Set FWID  ~ Flange Width   (Real) (setq BBPT (list 0.0 0.0 0.0))                                            ;Set Block Base Point (setq EXDR (list 0.0 0.0 1.0))                                            ;Set Extrusion Direction
 
I also put this back in place.
  1.   (or G:WID    (setq G:WID 500.0))                                          ;Set Grille Width   default to 300,       Remember last setting (setq G:WID$ (rtos G:WID 2 0))                                            ;Set Grille Width Value, Return Grille Width to string (or F:DIR$   (setq F:DIR$ "R"))                                           ;Set Flow Direction default to R ~ Right, Remember last setting (setq G:WID                                                               ;Set Grille width   (cond                                                                   ;Condition     ((getreal (strcat "\nSpecify the width of the grille : "))) ;Get distance, Show default     (T G:WID)                                                             ;If Enter is selected, Set to default G:WID ~ Grille Width   )                                                                       ;End condition )                                                                         ;End of setq (initget 8 "R L")                                                         ;Establish keyword for Flow Direction R ~ Right or L ~ Left (setq F:DIR$                                                              ;Set Flow Direction   (cond                                                                   ;Condition     ((getkword (strcat"\nFlow direction? (R or L) : ")))        ;Pause for keyword     (T F:DIR$)                                                            ;If Enter is selected, Set to default F:DIR ~ Flow Direction   )                                                                       ;End condition )                                                                         ;End of setq
 
 
Attached is the fixed version.
SAG2.zip
回复

使用道具 举报

8

主题

71

帖子

66

银币

初来乍到

Rank: 1

铜币
43
发表于 2022-7-6 12:54:46 | 显示全部楼层
Buzz
       Thats just fantastic. Of-course i will be using this one after editing it a bit. But should definitely workout. I liked your code very much its the best.
thanks for your efforts for your line to line explanation. Thats just great.
The best part of it was the degrees to radians conversion in it.
        I also tried to make mine  a little better than previous.(of-course cant compare with that of yours). I ve also attached an actual use of the same.
If you see mine , i dont want the branch(collar) to be included in the block coz the collar length is always varying.
       Anyways i got my direction & will manage with a little bit change in yours. If i dont get it i ll be back to trouble you again.
sag.zip
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 12:59:59 | 显示全部楼层
Not a problem at all. Glad to help.
 
I am sure you will notice some features that may be of use to you. I covered an awfull lot in this one.
 
Good Luck,
And let me know how its going,
The Buzzard
回复

使用道具 举报

8

主题

71

帖子

66

银币

初来乍到

Rank: 1

铜币
43
发表于 2022-7-6 13:00:41 | 显示全部楼层
Thanks a lot Buzz
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 13:04:20 | 显示全部楼层
 
I just love this line:
 
Flowpath please : \Hey man where to put this :
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 13:08:59 | 显示全部楼层
Vivian,
 
I am going to take another crack at this program, But I will utilize your method since I now have an idea as to what the variables are. I would like to point out though that I have the air flow direction Left & Right for the reason that you would need to be able to place these Grilles on either side of the duct with respect to Air Flow direction. The rotation feature is only to make the Branchs perpendicular to the main duct. Basically they will look mirrored even though they are not.
 
See attached image.
 
You will also need to put the Save User Settings feature in along with the Restore User Settings.
 
The layer function that I use, Uses the Make sub-command. This will make a new layer if its not in the drawing and set it if it is. I also want to mention that that function will take into account that if a layer in your drawing is frozen, It will then thaw and set it.
 
Finally there is also all your command calls which are not set to be langauge compatable with versions of Acad that come in other langauges.
 
Example:
  1. (command "layer" "n" "GRILLE" "c" "30" "GRILLE" "")     Not langauge compatable.(command "_.layer" "_n" "GRILLE" "_c" "30" "GRILLE" "") This is langauge compatable.
 
I will also put in the default data settings as well.
 
The code will be alot smaller then the previous one I posted, But will work in the method you would expect. This should bring you much closer to your goal. I will be putting this together over the weekend. I need the practice as well since I have not made any codes in the last few months. I may have it done for early next week.
 
I will contact you then.
131605k008mii10plqggkg.jpg
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 13:12:01 | 显示全部楼层
Viv,
 
Its your lucky day.
 
Please test out the attached program SAG4.lsp. As I mentioned before, This program is done with all command call as in your program. The only difference is that this has all the neat features of the SAG2.lsp. The block is now on its own layer GRILLE and the duct is on a layer called DUCTING and are line entities. When you get time let me know what you think. By the way, There is a sketch of the objects variables for the grille and duct done in the program to help you follow my variables.
 
This program is your concept, I just arranged it differently.
 
Enjoy!
The Buzzard
SAG4.zip
回复

使用道具 举报

8

主题

71

帖子

66

银币

初来乍到

Rank: 1

铜币
43
发表于 2022-7-6 13:13:43 | 显示全部楼层
Buzz
 
Its definately my lucky day. This is really the best one. Thanks for all your support in making this concept work in a more better way than i had ever thought. I also came to know about many new things from your point to point explanation for each line in the program.
 
Regards
Vivian
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-6 13:17:07 | 显示全部楼层
Viv,
 
That's great to know, I do not mind at all when others show a willingness to learn. It seems to me you are willing to put in the time to learn and that is a big reward to me in itself.
 
I realize that the insertion point on that last code was not where you had it, But there was less programming involved to acheive the results from using my own judgement. I hope it works out for you and you continue to show the ability to improve your coding. Of course you can change this to way you deem fit.
 
Again, If you have any questions, Please feel free to ask. I am not one of the better programmers on this site, But I do wish to give back to this site to others who have the willingness to take their codes up a notch.
 
I can only do for this site with the learning I have received, And if this helps you any, Then I have gotton more back then you will ever know. I can only hope that you will return your new found knowledge back here some day to keep this site as special as it is to me.
 
I know sometimes some folks here do not understand this concept, But it is what make some here give back to others for their efforts.
 
One thing I realized was, You would be able to relate to this code because it was your concept from the beginning. It only makes it that much easier for you to take this code to a point that is even better than what I could put out.
 
Good Luck and keep cracking at it,
I learned even more from you than you know.
The Buzzard
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-5 06:07 , Processed in 0.382735 second(s), 73 queries .

© 2020-2025 乐筑天下

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