Visual LISP, AutoLISP and General Customization

Reply
*Expert Elite*
Kent1Cooper
Posts: 5,237
Registered: ‎09-13-2004
Message 31 of 34 (298 Views)

Re: Pre-defined find & replace lisp

05-22-2013 06:21 AM in reply to: BlackBox_

BlackBoxCAD wrote:
....
Becuase you and I share a passion for both correctness, and completeness... You use them so often, that I thought you might enjoy using them correctly even more:

Grammar Girl: Parentheses, Brackets, and Braces


I always use brackets for "parenthetical" remarks, quite intentionally in this AutoCAD Customization context even though they may not be proper in a literary context, in order to keep the distinction between them and the parentheses used with AutoLISP functions.  The latter I always refer to in parentheses, such as to say "look into the (vlax-curve-isClosed) function."  Since in that usage they don't indicate a "parenthetical," I use brackets when that's what I mean.  [Besides, you don't need to use the Shift key for brackets, as you do for parentheses.]

Kent Cooper
*Expert Elite*
Kent1Cooper
Posts: 5,237
Registered: ‎09-13-2004
Message 32 of 34 (296 Views)

Re: Pre-defined find & replace lisp

05-22-2013 06:40 AM in reply to: BlackBox_

BlackBoxCAD wrote:
.... 

Given the already-existing [RText] elements you speculate, kindly educate me as to how you'd change an RText Field from it's diesel expression's calculated value, to "Mickey Mouse," without the use of opening the drawing in the editor, nor custom code, within AutoCAD and no other application.


Where is this Diesel angle coming from?  There's no Diesel involved, there's no calculated value, there's just text-character content.  I'm talking about just plain Rtext, and not an Rtext Field, if that's something different.  [Bear in mind that not everyone has the capability of Fields, nor Sheet Sets.  There are many who participate here who use older versions of AutoCAD without those features or various others -- Tables, dynamic Blocks, etc.  And I'm not even the only Expert Elite member who uses 2004 at work, not by our choice.]

 

The "...within AutoCAD and no other application..." was not part of your original statement, which was incorrect as stated, but apparently didn't reflect what you intended.  If you add that requirement, then no, you can't do it without getting into Notepad or equivalent, but you still don't have to open any drawing at all, nor use any custom code at all.  Since I can't try it, tell me: can you modify the content of a Field without even having AutoCAD running, as you can with Rtext?

 

[And if you're going to get picky about punctuation, I'll join you:  that should be its.  It's one of the most common such errors, but there's an easy way to remember: no possessive pronoun contains an apostrophe.  Just as mine and your and our and his and her and their don't have them, neither do its or hers or yours or ours or theirs.  "It's" with an apostrophe is only the contraction of "it is."]

Kent Cooper
Distinguished Mentor
BlackBox_
Posts: 733
Registered: ‎02-25-2013
Message 33 of 34 (290 Views)

Re: Pre-defined find & replace lisp

05-22-2013 08:44 AM in reply to: Kent1Cooper

Kent1Cooper wrote:

BlackBoxCAD wrote:
.... 

Given the already-existing [RText] elements you speculate, kindly educate me as to how you'd change an RText Field from it's diesel expression's calculated value, to "Mickey Mouse," without the use of opening the drawing in the editor, nor custom code, within AutoCAD and no other application.


Where is this Diesel angle coming from?  There's no Diesel involved, there's no calculated value, there's just text-character content.  I'm talking about just plain Rtext, and not an Rtext Field, if that's something different.  [Bear in mind that not everyone has the capability of Fields, nor Sheet Sets.  There are many who participate here who use older versions of AutoCAD without those features or various others -- Tables, dynamic Blocks, etc.  And I'm not even the only Expert Elite member who uses 2004 at work, not by our choice.]

 

The "...within AutoCAD and no other application..." was not part of your original statement, which was incorrect as stated, but apparently didn't reflect what you intended.  If you add that requirement, then no, you can't do it without getting into Notepad or equivalent, but you still don't have to open any drawing at all, nor use any custom code at all.  Since I can't try it, tell me: can you modify the content of a Field without even having AutoCAD running, as you can with Rtext?

 

[And if you're going to get picky about punctuation, I'll join you:  that should be its.  It's one of the most common such errors, but there's an easy way to remember: no possessive pronoun contains an apostrophe.  Just as mine and your and our and his and her and their don't have them, neither do its or hers or yours or ours or theirs.  "It's" with an apostrophe is only the contraction of "it is."]


"no, you can't do it"

Thanks for confirming... I appreciate your honesty, Kent.

 

More on the text file option below.

 

 

 

"Where is this Diesel angle coming from?"

From my multiple prior statements referencing the limitations of Diesel expressions in RText, which you never once addressed to instead discuss an external text file dependency prior to my challenging you to educate me... Instances where I even referenced items such as file path, file name, saved date, etc.

 

"The "...within AutoCAD and no other application..." was not part of your original statement, which was incorrect as stated, but apparently didn't reflect what you intended."

If it was your intention to work on an external text file, that's fine... You just never made the time to include that little morsel of information in your responses, which is why I purposefully included it to mimic the SSM criteria... One could say that you failed to reflect what you intended, so-to-speak (until now, that is), but I'll give you the benefit of the doubt, my friend.

 

"Since I can't try it, tell me: can you modify the content of a Field without even having AutoCAD running, as you can with Rtext?"

Yes.

 

From Visual Studio (a glorified text editor), one can access the Sheet Set Manager API via ActiveX COM, or .NET (never tried this for myself), and programmatically modify the content source a Field read's from (similar to an RText external file dependency, just encrypted in lieu of plain text)... This, however, requires custom code which is why I chose to remain consistent in my challenge to you, by maintaining the "within AutoCAD" criteria which most users are relegated to when accessing SSM. 

 

Now that stage one thinking is out of the way (we now have modified RText, Field, etc.), stage two warrants the question... And then what?

 

Plotting said change(s) (as I clearly included previously)... Since one cannot plot modified RText from one's external text editor, one would still require AutoCAD**... So the ability to modify RText, or SSM outside of AutoCAD is irrelevent for a typical production task (as a generalization)... Something that I'd like to believe you'd agree is a fair statement.

 

** Core Console (AcCoreMgd.dll) is part of AutoCAD, as it consumes the same license required. The use of another application such as TrueView falls under the AutoCAD umbrella, despite being a stand alone application.

 

"There are many who participate here who use older versions of AutoCAD without those features or various others -- Tables, dynamic Blocks, etc.  And I'm not even the only Expert Elite member who uses 2004 at work, not by our choice.]"

Of course not everyone is on the same version, but I did not realize you approach your argument(s) from a 2004 point of view... If you mentioned it previously, then I mistakenly overlooked that pertinent information. I honestly cannot remember the limitations of 2004 as compared to the multiple versions installed here (2009-2014).

 

That must be frustrating for you, especially when someone like me comes along making the case for new fangled things... SSM is quite old as I understand it, but still.

 

It's hard enough for me to just keep straight the myriad distinctions between Land Desktop, Civil 3D, Map 3D, Plant 3D, and AMEP (we don't use vanilla AutoCAD).

 

"And if you're going to get picky about punctuation, I'll join you:"

Silly me, thanks, Kent... I appreciate the constructive criticism.

 

For what it's worth, I truly was not nitpicking you; you repeat the use of brackets, etc. very frequently... If it were, say, a misplaced apostrophe once in a while, I never would have mentioned it, my friend.

 

 

 

May I be so bold to assume we agree that we've more than sufficiently covered both the limitations, and benefits of both SSM, and RText to conclude this tangential discussion?

 

Always a pleasure... Unfortunately, I'm beginning to like you, Kent.

 

 

Cheers



"Potential has a shelf life." - Margaret Atwood


Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security

New Member
armando1903
Posts: 1
Registered: ‎09-05-2013
Message 34 of 34 (216 Views)

Re: Pre-defined find & replace lisp

09-05-2013 02:06 PM in reply to: cadee

Hi wanted to know how to make the lisp pre-defined find and replace you created but for only the selected text and not every occurrence, or how replace pre-defined text with existing text for  text ,mtext, and attributes . I have to do this manually every day.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community