Strydaris Posted September 23, 2024 Posted September 23, 2024 Hey everyone, I am trying to figure out how to hide some LISP code from displaying in the command line when using a CUI custom command. I am trying to add an area in my CUI for the user to set some variables that will be used on multiple LISPs. I current made a custom command that has just this.... ^C^C(setq F2B (getreal "Enter Front to Back slopes: ")) But when I click the buttom in the CUI I get this... ^C^C(setq F2B (getreal "Enter Front to Back slopes:")) Enter Front to Back slopes: Is there anyway to hide the LISP code or would I have to take a different approach? Thanks, Quote
Strydaris Posted September 29, 2024 Author Posted September 29, 2024 So I found out the answer to my own question. If you are looking to hide part of you macro in the command line, you needs to wrap it a "^P" (Ignore the quotes) For example, here is a simple lisp code that I want to use to ask the user to set some variables that can / will be used in multiple lisps. ^C^C^P(setq F2B (getreal "Enter Rise for Front to Back slopes: ")) By adding the ^P it will no longer show the "CODE" part of it, but will show the prompt of "Enter Rise for Front to Back slopes: " on the command line. Quote
tombu Posted October 7, 2024 Posted October 7, 2024 Help reference: About Special Control Characters in Command Macros https://help.autodesk.com/view/ACD/2025/ENU/?guid=GUID-DDDB6E26-75E1-4643-8C6A-BEAEBA83A424 Quote
CivilTechSource Posted yesterday at 11:47 AM Posted yesterday at 11:47 AM Can you then have a different Lisp read the F2b value? Quote
BIGAL Posted 18 hours ago Posted 18 hours ago A suggestion use a "\n" in the (getreal "\nEnter Rise...) this will push a new line on the command line. If the F2b is a global variable then any lisp can read it, but that is not necessarily a good idea. Its easier to do a double lisp in the cui. So load the program and call a defun passing it the f2b value. ^C^C^P(setq F2B (getreal "Enter Rise for Front to Back slopes: "))(load "mylisp")(mylisp f2b) I use LDATA when I want values stored in a dwg they stay in the dwg and can be changed. 1 Quote
Strydaris Posted 18 hours ago Author Posted 18 hours ago @CivilTechSource Yes you can make the variable global by not clearing it in the lisp routine. If you aren't familiar with what I am taking about in a lisp you write at the top this.. (defun c:lisp ( / variable1 variable2) ) If you set a value to variable3 as long as it's not in the list like variable1 is then it's consider a global variable which can be used by multiple lisps. Typically I see people use something like global:variable1 to know which is which. Hope that helps. 1 Quote
CivilTechSource Posted 5 hours ago Posted 5 hours ago That is really handy to know! Would it be wise to create a Textbox in the CUI where the user can input a number eg. text height and then all lisps that run can use the text height specified globally? Quote
Strydaris Posted 4 hours ago Author Posted 4 hours ago @CivilTechSource You could do it that way, but I wouldnt . I would use the built in Styles and have the user select which style to use. If using AutoCAD you should expect the user to have a certain level of usability in the work space. If they dont have the level then do not make it easier for them, make them use CAD the way its intended. By doing that you are making sure that they learn CAD and also use the office CAD Standards how they are intended to be used. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.