I posted a version of the Offset command that lets you Undo individual Offsets and change the offset distance/Through option, without getting out of the command, at Cadalyst CAD Tips: URL....
It's an upgraded version of an earlier concept by Gopal Ramesh. It's been downloaded almost three times every day since it went up, so I guess people expect it will be useful.
But the website's description includes: "this routine does not provide access to the Layer or Erase options of the built-in Offset command." The reason for that is that I'm working back in 2004, so those options are not present for me to emulate. [The Undo option in the routine is one that was added in some later version, but is a very useful enhancement for people using older versions, like me.]
I do also have an Offset-to-any-Layer [not just the source's or the current Layer] routine posted there: URL....
And I have a simple little routine to Offset something and Erase the source object. So I think I have all the "pieces" to include those options that newer versions have, but that I don't. I would like to combine the functionalities into the Offset-with-running-options routine. That way, if people want to use it to redefine the Offset command as I have done, in order to get the while-running distance change option, those working in newer versions won't be losing the Erase and Layer options in the process, and those in older versions will be gaining yet more options.
I am a beginner at LISP and this is a bit out of my league... and I'm trying to create a lisp where I can draw a polyline between 2 points that also places text with the actual distance offset above the line.
I did find this post and I'm not quite catching on.. [URL] ......
I am writing a lisp routine to automate creation of views. In the routine I am setting ucs to match user-supplied points, setting my view orthagonal to the temporary ucs, then setting ucs back to world.
The first object works. The routine creates the ucs, creates the view, asks for the next object to start anew, and then stops because AutoCAD is asking if I want to "Save current UCS with named views?" I thought I would just make a "Temporary" ucs, but if I do that, AutoCAD wants to know if I want to overwrite "Temporary" because I created that ucs name the first time through.
Is it possible to control the UCS without using the command line? I'd like to access it and control it with vlisp much the same way I can access DXF groups and manipulate insertions. Seems like it should be possible to play with it's definition inside the object model.
I have a custom command that I can initiate (c:TxtE). The function starts running but I need to begin adding several inputs at the command line following this. (ex: "4" "all" "" "oldtext" "newtext"). How do i do that within lisp once the custom command has already begun? If I need to modify the function how would i pass all these as optional type variables?
I want to use it to plot different views which I will append to the command when it is called from within AutoCAD.This code will, of course, print view one.Currently my worst case is 25 views and, for that situation, I have simply repeated this code 25 times with a different function name an view number for each view. Eventually I would like to make a dialog box that would allow me to select with checkboxes (toggles) the views to print and with a button to print all.
For example, if I wanted to plot view 25, after I had loaded this lisp routine I would enter, on the command line in AutoCAD, the function name ("pp" perhaps?) followed by some variable (in this case 25, but could be any view name. ie. 01, elev, detail) and the view name would be inserted at the appropriate place.
I like that Autodesk now allows us to just pick a command's option from the command line instead of typing a letter in the option. For example, when drawing a rectangle we're prompted to "Specify first corner point or [Chamfer Elecation Fillet Thickness Width]" and if we wanted to draw fillets on the rectangle we can simply PICK that option from the prompt in the command line OR enter an "F" and return.
Is there a way we can use this functionality in our custom programs?
I cannot determine what triggers this but the command line has stopped returning values from lisp expressions.
eg. If I type (setq fred "Hello") I would expect to see "Hello" returned. I am getting nothing. Similarly if I type !fred I get nothing. If I restart AutoCAD the problem goes away. The after some time it happens again. Is there a toggle or switch or system variable that I'm not aware of?
I'm running AutoCAD 2012 (base version, but part of Mechanical install). Part of my .mnl file is set to run (command "cube" "off"). On one machine (Windows 7), it works fine. I'm temporarily on my laptop (Windows 8), & that portion no longer works.
If I type cube in the command line, it works fine. However, if I type (command "cube"), it says unknown command "CUBE".
I have a list of dotted pairs and some of the entries are paired with a deeper list others contain mostly string data. the issue is that I need to print the data to the command line with a newline to seperate them. So I want the output to look like:
;from(customer (city . "Mesa")(zip . "85213")(project (scope (demo . "some description")(construction . "some description")) (cost (subtotal . "some subtotal") (total . "some total"))));tocity Mesazip 85213demo some descriptionconstruction some descriptionsubtotal some subtotaltotal some total
But, the issue is that when the data is a list it print it out to a single line making it very difficult to read. I tried adding another FOREACH into the loop that I had hoped would iterate through the deeper list and print those lines out in a simular fashion but I only get an "error: bad argument type: consp " and it displays the first element of my list.
I tried to evaluate the IDX and check the type, so that if it is a list then it triggers the deeper FOREACH but it seems I did it wrongly.
I've been killing myself with trying to get the following (acet-getvar '("BNS_EDITTIME_TOTAL")) in standard time format
rather than julian and then printing it to a file. I never found a way. So I'm figuring the next best thing is to just run the edittime command and then set a custom variable to report the last line of the command history. Then I can open a file and print it to the file. But alas my skills are lacking.
I am trying to get a default value (from global variable) put as the default for getstring command. Problem is I want it as if I had typed it into the getstring command so I can modify it if required. It is for entering filenames which only change slightly ie 1129E09LS1 ...LS2 ...XS1 etc.
Current (setq BlkName (getstring " Enter Civil Cad File to Import: ")) For defaults that I don't want to change I usually use this format: (or BlkName (setq BlkName (getstring " Enter Civil Cad File to Import: ")))
I'm writing some code to create various structural members, but I also need to add the texture map. Since it is doing the creation via VL, I need a way to add a material without that darn dialog box. Can material be add to a member programaticlly?
I'd like to change a layer's color from command line because of a user icon. I figured out from previous topics that I should use macro similar to this: ^C^C_filedia;0;-la;s;Verdeckt (ISO);c;1;l;dashed;;_filedia;1;re;
(I want to use this macro to change layer's linetype, too, but that's not the point)
The only problem with this macro: layer's name contains a space therefore Autocad tries to recognize Verdeckt as a command (and macro interrupts there) instead of setting Verdeckt (ISO) as the current layer. I've tried using different quote marks, none of them worked (' and " and <>). I hope there's a method for entering a parameter that contains space.
Software: Inventor Series 2011 SP1 x64 OS: Vista Business x64 CPU: E6400 RAM: 2*2Gb GeIL VGA: Quadro FX 550
I want to know the correct way to find the offset origin of a layout in an AutoCAD drawing. Let say I have a drawing that has many items on it. And I create a layout showing just the items in the lower right corner of the drawing. I want to know the offset origin of this layout relative to the Model space.
I came across some LISP commands that are supposed to do just that:
I've been looking for a lisp program. I've tried to mix-and-match code to come up with a working lisp but nothing is working. I am using a polyline rectangle to start with, offsetting it out 0.75 outward, and triming everything outside of the offset and erasing the offset.
I am currently writing a series of routines for setting the layers for text, leaders and dimension commands. The end goal is a system where any annotation command sets the correct layer for the duration of the command, then reverts back to the layer that was active before the command.
I have managed to complete all the code, and it appears to be working fine, I just have one question: I have used -layer "m" "Lay_name" etc... for all layer setting commands, rather than any code to see if the layer exists already. In my limited testing this seems to be suitable, nothing that exists on that layer seems to be affected.
I know how to write code to determine if the layer exists already and set the layer instead, but so far it seems unnecessary??
I have a attributed titleblock. Sometime in the future I will need to change the date attribute to another value, i.e.. 7-11 to 9-11.
I can't place a text string in the title block because this title block is used for multiple drawings and the date will be different for different sets. I can't have numerous title blocks because of the client's requirements.
Is there a way to write a script to open a drawing, look for the specific attribute, change the date value, save and close the drawing - across multiple sheets? Would a lisp routine called by the script be able to do this? Or a script file called by the original script file? CAn you even use a script file in this manner?