乐筑天下

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

[编程交流] 递增nu时需要帮助

[复制链接]

14

主题

68

帖子

54

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-5 23:33:23 | 显示全部楼层
 
 
李,你好,
 
 
谢谢你。你的代码非常接近我需要的。我试着理解它的每一行,希望我能稍微调整一下以满足我的要求。我的问题是我对vlisp不是很熟悉,所以我想知道你们是否能帮我解决我现在正在努力解决的问题:
 
我要替换此选择集:
(if(ssget“_X”'((0。“多行文字,文本”)(1。“*#*”))
 
选择一系列数字。比如,只选择
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 23:37:26 | 显示全部楼层
 
Change:
  1. (1 . "*#*")
To:
  1. (1 . "2[3-9],3[0-9],4[0-5]")
回复

使用道具 举报

14

主题

68

帖子

54

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-5 23:41:51 | 显示全部楼层
 
 
Hi Lee Mac,
 
 
Thanks for your reply.  I just realised that I forgot to mention the most important words in my query and that is "by prompt".  Apologies for that Lee. I actually meant as two prompts like: "From number:" and "To number:".  Your code is selecting either all the numbers or by manual selection -- can I have them only as prompts because there are just too many texts/numbers to be selected manually and not all of them need to be replaced?
回复

使用道具 举报

28

主题

317

帖子

292

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
140
发表于 2022-7-5 23:43:49 | 显示全部楼层
No problem Artek. I'm not 100% sure but I think that I don't get all notifications either. I just saw your reply as well.
I'm not an instructor, I'm just a 2nd-year-padawan-guy who got carried away a little, but thanks!
I had a very basic knowledge but decided to dive seriously into it maybe 6 months back. For someone who wants to learn on his own (like me) this community is a great resource. Plenty of examples, explanations, and people with different backgrounds (AutoLisp, VLisp, ActiveX..) I've read few very detailed explanations here and there about a bunch of functions and most of the times I've learned much more from them then the basic help from autodesk. I try to give some help back when I can, not to mention that the best way to learn is to practice. In my case, few days prior to your first post one member helped me understand lamda function and explained me recursive lambda embedded lamba concept, so helping you helped me as well
With lisp everything is possible, just dive and give it a try! If you still have issues to work out, post your work in progress.
回复

使用道具 举报

14

主题

68

帖子

54

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-5 23:50:17 | 显示全部楼层
Hi Jef,
 
To be honest with you it would take me ages to produce a code like you did. I tried to study each line but I just ended up scratching my head in confusion.  Also tried to modify it but I'm not sure what I'm supposed to do or even where to start.
 
Going back to our topic.   Lee Mac suggested his code earlier on this post. I've attached again the link for your reference below:
 

 
It's a brilliant code same as your one only a bit shorter and easy  to follow for my level! It would have been perfect for my need if only there are prompts for starting and ending numbers to process. I'm still hoping that either you or Lee Mac can help me with this request. Cheers!
回复

使用道具 举报

28

主题

317

帖子

292

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
140
发表于 2022-7-5 23:54:11 | 显示全部楼层
Hi Artek.
 
I had the same kind of thoughts few months back. I rolled up my sleeves and dug in because I really wanted to learn lisp. At the beginning, Lee drop into one of my threads and gave me equivalences of some things I made in AutoLisp and commands. He made the same things in VLisp and ActiveX. "Here's some food for thoughts" he said. At first I freaked out a little and discarded most of it saying that I wasn't at this level yet, and wanted to do it only by lisp because at that time I had no knowledge of VLisp and ActiveX. Later on, I started to try to get a hand onto VLisp and ActiveX, and wasn't able to achieve what I wanted. I googled what I needed and.. the first result was in that "food for thoughts" that I discarded on my very own thread. I don't know how someone can laugh and feel bad at the same time, but I manage to do it.
 
I must say that Lee is one of the best and most active member that I had the chance to stumble upon not only here, but in many other forums (autodesks, augi...) and I'm pretty sure he has over 50 000  posts all added together (over 16 000 here). And beside "you are welcome" at the end of threads, most of them are simply gold mines. He has a way to simplify code and achieve things without unnecessay detours. That comes with experience. To be perfectly honest with you, I would not be comfortable modifying one of Lee Mac's code (to mold it to suit your needs). It would be the same as asking any painter to do touch ups to The Mona Lisa because even if its not the way da Vinci made it, you'd like to see it with a red background to fit with your couch. I hope you'll understand.
 
It would take you ages to produce such code? Maybe it would take you some time, but it is not impossible. Few things that I can tell you: put only 100 hours in Lisp, you'll be amazed of what you will be able to achieve. When I make Lisps, I always add princ/prompts to monitor variables, and alerts to "freeze" the execution. As long as I don't hit the "ok" button, the lisp is paused. Depending on the popup alert displayed, I know exactly where the execution paused (searching for the popup ed alert into my code), and looking at the lines printed on my cad session, I monitor my variables. When I understand whats going on, I hit "ok" to resume to the next alert. I could have erased them, the lisp would be much shorter, but I didn't; I commented them (by adding ";" in front of them). My code might look longer for that, but it has a higher educative purpose; suppress all the ";" and you'll be able to follow the execution of the code line by line. I'm not as fluent as Lee to make lisp routines, that one took me in between 12 to 14 hours to make. I'm glad I did it though.
 
I know that my code isn't as efficient as Lee's, but I "dare" you to uncomment every one of my princ/alerts, and spend only half the time that I took to make the lisp to really try to understand it. If you don't know a function, google and study it as needed then go back to the execution. You WILL get most of it. Give yourself a chance! You might have to spend some hours but every time you'll make new connections and learn new things, you will potentially save a lot more making lisp to automatically do redundant tasks. See that as an investment.
 
You went from Please give me an idea on how to to I want to replace this to the code Lee generously gave you to I actually meant as two prompts like: "From number:" and "To number:"... sometimes the modification is simple, but sometimes different goal also quite often mean different path. On the last request my feeling (as a few months old lisper) is that it would take quite some tweeking to achieve your goal.
 
Sorry for the length of my post, I write too much, and add too much details (I know), but I'd be curious to have your estimation on these:
-How much time do you think I took to write the code, the detailed explanation and that message?
-How much time do you think Lee took to write his original routine, read this thread and tweak it at your request?
-How much time did you spend to try to study our routines to learn new stuff?
Give it a try!
 
The way I see things; If you want to get some advices on how to proceed, you need help to understand some functions, or want feedback on your routines, this place is the best around. If you want the best lispers to give you custom tools for free, you misinterpreted the goal of this forum...
 
That being said, I wish you good luck on achieving your goals.
Cheers,
Jef!
The views and opinions expressed in this post are mine alone and are not necessarily representative of the views and opinions of any other members nor cadtutor.net... just saying =)
回复

使用道具 举报

14

主题

68

帖子

54

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
70
发表于 2022-7-5 23:55:24 | 显示全部楼层
Thanks very much for the thoughts Jef! I'll take those into consideration. I got mixed reactions after reading your post - I don't know if I should feel encouraged by it or feel guilty about the whole thing. I do appreciate your time and effort and I'll try to heed your advice and hopefully be in the position to give advice to others in the future.  Glad that there are people like you around.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-11 03:10 , Processed in 0.455076 second(s), 64 queries .

© 2020-2025 乐筑天下

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