Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Inch marks in lisp?

11 REPLIES 11
Reply
Message 1 of 12
cantieny
611 Views, 11 Replies

Inch marks in lisp?

I am trying to use the command function to input text with a lisp routine, no problem. If I want the text to contain and inch mark (say 2'-4" o/c), problem. Is there a way to get lisp to see the rest of the string after the inch marks?
Thanks
Chuck Cantieny
11 REPLIES 11
Message 2 of 12
Anonymous
in reply to: cantieny

Preceed the " with a \

 

2'-4\" o/c


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I
am trying to use the command function to input text with a lisp routine, no
problem. If I want the text to contain and inch mark (say 2'-4" o/c), problem.
Is there a way to get lisp to see the rest of the string after the inch marks?

Thanks
Chuck Cantieny
Message 3 of 12
Anonymous
in reply to: cantieny

USE (2) "" TO DISPLAY THE INCH MARK I
THINK?

 

GIVE THAT A TRY AND SEE IF THAT DOES THE
TRICK


--
Timothy G. Spangler
Product Manager
Rasche Brothers
Inc.


style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
I
am trying to use the command function to input text with a lisp routine, no
problem. If I want the text to contain and inch mark (say 2'-4" o/c), problem.
Is there a way to get lisp to see the rest of the string after the inch marks?

Thanks
Chuck Cantieny
Message 4 of 12
Anonymous
in reply to: cantieny

nope, that's a VB thing. Use the \" that Jim suggested.

--
Ben Maki
NDC Inc.
Message 5 of 12
cantieny
in reply to: cantieny

Thanks Guys but I think I left out some important info. The text is defined as a variable that is set in my menu that calls a lisp sub-routine to print it. I think the problem may be in defining the variable.

the menu = (setq bnote "2'-4"o/c") addnote
(or now = (setq bnote "2'-4\"o/c") addnote

The addnote sub-routine = (command "_mtext" (getpoint "\n Pick first corner of text box: ") (getpoint "\n Pick second corner of text box: ") bnote "")

with the \" it hangs the menu portion defining the variable.

Thank You,
Chuck Cantieny
Message 6 of 12
Anonymous
in reply to: cantieny

AutoLISP doesn't always work too well in menu files, and here's one example
of that. One way to deal with that is to edit the .mnl file with the same
name as the .mns or .mnu file that you are editing. If there is none,
create it. Create a function in the .mnl file that will be called by the
line in the .mns file.
Message 7 of 12
cantieny
in reply to: cantieny

Yes. The addnote sub-routine is in the MNL file. I am setting the variable name (bnote) in the .MNS file.
Chuck
Message 8 of 12
Anonymous
in reply to: cantieny

Is there a reason you don't want to set the variable name in the .mnl file?
In a function to be called by the .mns file?

cantieny wrote in message ...
>Yes. The addnote sub-routine is in the MNL file. I am setting the variable
name (bnote) in the .MNS file.
>Chuck
>
Message 9 of 12
Anonymous
in reply to: cantieny

i work around it with with using (chr 34)


(setq a (strcat "2'-4" (chr 34) "o/c"))

pieter


cantieny wrote:

> Thanks Guys but I think I left out some important info. The text is
> defined as a variable that is set in my menu that calls a lisp
> sub-routine to print it. I think the problem may be in defining the
> variable.
>
> the menu = (setq bnote "2'-4"o/c") addnote
> (or now = (setq bnote "2'-4\"o/c") addnote
>
> The addnote sub-routine = (command "_mtext" (getpoint "\n Pick first
> corner of text box: ") (getpoint "\n Pick second corner of text box:
> ") bnote "")
>
> with the \" it hangs the menu portion defining the variable.
>
> Thank You,
> Chuck Cantieny
Message 10 of 12
Anonymous
in reply to: cantieny

2'-4\"


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I
am trying to use the command function to input text with a lisp routine, no
problem. If I want the text to contain and inch mark (say 2'-4" o/c), problem.
Is there a way to get lisp to see the rest of the string after the inch marks?

Thanks
Chuck Cantieny
Message 11 of 12
Anonymous
in reply to: cantieny

This is the REAL answer and should work in menus!
Here is a little routine called aski.lsp that helps you identify the ascii
character numbers

(defun c:aski (/ key)
(setvar "cmdecho" 0)
(setq key (getstring "\nEnter a key for ASCII conversion: "))
(prompt "\tThe ASCII code conversion is: ")(ascii key)
)

--

Bill DeShawn
bdeshawn@prodigy.net
http://pages.prodigy.net/bdeshawn/bdeshawn.htm


"pieter folkerts" wrote in message
news:3BB59E41.DE26C939@folkerts-pj.tmfweb.nl...
> i work around it with with using (chr 34)
>
>
> (setq a (strcat "2'-4" (chr 34) "o/c"))
>
> pieter
>
>
> cantieny wrote:
>
> > Thanks Guys but I think I left out some important info. The text is
> > defined as a variable that is set in my menu that calls a lisp
> > sub-routine to print it. I think the problem may be in defining the
> > variable.
> >
> > the menu = (setq bnote "2'-4"o/c") addnote
> > (or now = (setq bnote "2'-4\"o/c") addnote
> >
> > The addnote sub-routine = (command "_mtext" (getpoint "\n Pick first
> > corner of text box: ") (getpoint "\n Pick second corner of text box:
> > ") bnote "")
> >
> > with the \" it hangs the menu portion defining the variable.
> >
> > Thank You,
> > Chuck Cantieny
>
Message 12 of 12
Anonymous
in reply to: cantieny

What you are looking for is (setq a "2'-4%%34 o/c")
and then you can use (command "dtext" etc a etc) to use it.

 

Dave Alexander

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
I
am trying to use the command function to input text with a lisp routine, no
problem. If I want the text to contain and inch mark (say 2'-4" o/c), problem.
Is there a way to get lisp to see the rest of the string after the inch marks?

Thanks
Chuck Cantieny

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost