Recent Posts

Pages: [1] 2 3 ... 10
You want to only change text inside blocks, but not loose text?

It's great but I can not change the style of text, mtext become block.

The function is very efficient, I thought it was going to change all types of blocks.
But I can only select blocks of text as an attribute.
Text blocks and dynamic blocks are not modified.
How I can change the routine so you can select them?

Thank you.
AutoLISP (Vanilla / Visual) / Re: Questions for the experienced programmers
« Last post by Lee Mac on September 30, 2016, 06:52:10 pm »
AutoLISP (Vanilla / Visual) / Re: Questions for the experienced programmers
« Last post by John Kaul (Se7en) on September 30, 2016, 06:00:30 pm »
Typing this on my phone so I apologize for being brief.

In some languages you break a program into several files -i.e. You'd put all your "support functions" into other files other then the main programming logic (where you keep the meat of your program). This keeps your main program very clean -i.e. You don't have to worry yourself about the "unimportant (tried and true)" when reading/writing and maintaining your program. I wrote a utility to replicate this method for the lisp language. The utility is mostly in an "unmaintained" status now but I cannot imagine any new features that would ever need be added to it so it should be very useful as it is.
AutoLISP (Vanilla / Visual) / Re: Questions for the experienced programmers
« Last post by Grrr1337 on September 30, 2016, 05:18:50 pm »
I forgot to mention that I'm notepad++ guy aswell,
So I follow most of the stuff marko_ribar wrote (including partially debugging in VLIDE).
NPP++ seems quite flexible as it goes to formatting - compared with VLIDE, but I'm considering almost full transition as it seems its the best debugging tool for AutoLISP.
Still I'm not sure how one deals with half-a-meter long code without getting lost (I'm not there yet, but its good to be prepared).
I'll re-read your advices incase I missed something, thank you gentlemen!
AutoLISP (Vanilla / Visual) / Re: Questions for the experienced programmers
« Last post by kdub on September 30, 2016, 04:32:27 pm »
At the risk of repeating advice given  ....

You'll probably spend 10 times as long reading code as you will writing it, so make sure it's readable FOR YOU.

Functionally it doesn't matter a rats tail. Aesthetically it will matter to YOU. ( or it should )

At this stage you should have read enough code to know what you like the look of and know what is easy to read .. use that experience.

My recommendation is to use one of the formatting styles available in the VLIDE.
If you post code that has an unusual, unique set-out style chances are I'll ignore it (as in not bother to read it) or re-format it in the IDE I'm using.

If you stay with programming you'll get more benefit from breaking your code down into smaller individual functions and using suitable function and variable names than you will by worrying about formatting.

Something that is important to me is to ensure that the reader gets a chance to take a breath when reading my code.


AutoLISP (Vanilla / Visual) / Re: Reduce all lineweights
« Last post by roy_043 on September 30, 2016, 04:12:18 pm »
I didn't see OP state that their STB used object lineweight
True, the OP hasn't mentioned this, but reading between the lines this seems to be a reasonable assumption.

Here is an interesting article (in English) about using a compact STB in combination with layers with lineweights:
AutoLISP (Vanilla / Visual) / Re: Questions for the experienced programmers
« Last post by ribarm on September 30, 2016, 03:54:33 pm »
Hi Grrr, I'll just say what I think so don't consider it as must... I tend to use just 2 spaces when structuring loops and blocks of codes... I use Notepad ++ for quickly move blocks from left margin (edge) of code using setting of 2 spaces as TAB formatting... I don't see why Lee Mac uses 4 spaces and in your example there is also plenty of room, so it's just personal structuring habit... Although it's not necessity like irneb stated it's quicker to close brackets in the same line of paragraph, but I don't like it much - then I don't see code elegant structured in blocks and I tend to avoid such situations... Notepad ++ have also ability to mark open bracket with closing one so it's easy to see where the problem may occur... Also when checking for parentheses it's nice to use sometimes VLIDE editor and mark blocks of code from end up to beginning of code... Then you can bump into unbalanced matching of brackets more reliably... But beside nice look of coding that's not the most important thing when coding bigger lisps... The most important thing is that the routine works as expected... There are quite lot of thing that may happen when debugging : typo mistakes, evaluation of variable as nil which will produce error in next coded syntax, sometime it's good to step from parametric programming - I mean using formulas to numerical coding, and sometimes it's totally opposite you need to convert hard coded numbers into parametric formulas... For me it's the hardest bug to find where was wrong evaluation when last break point is inside sub function, so you can't step backwards to see when sub function was called ( was it early or somewhere in the middle of code or the problem appeared near end of routine )... For this you have to have intuition and experience to have correct assumption and to find where the problem was... Almost all codes that have considerable length won't work from first testing attempt... So the most important thing is that when you coded much to be concentrate and patient - not to give up and leave bug to be unsolved... You have to be very persistent in debugging and like others stated it's important to know where to put break points while checking problematic portion of code... Animation option is useful too, but more important is to be sure what routine is doing from beginning to the end and to spot where such problematic portion of code was written to correctly set break point before it, then use inspect tool and watch window with all necessary variables filled in window and analyze what returns are... Sometime the problem is in sub function that is correct but for different routine and in your new routine it needed to be modified to suit different algorithm processing... And so much more can be discussed on it, but like MP stated and I agree 100% with it when it works, it works and beauty of coding may be or not pretty to someone or not, but functionality isn't questionable when it works as it should...
Pages: [1] 2 3 ... 10