Block insertion from menu

HI guys,I have for several years userd a little lisp to insert blocks from menus.(defun C:blins ( fpath / )(setvar "expert" 5)(command ".insert" fpath pause 1 1 pause "expert" 0 "regenall"));eofThis works nicely using a commandline like this(blins"C:\drawings\kassetter.dwg")The problem is that since the introduction of V8 this block insertion will not repeat on richt_clicking.SUPPORT says its fixed in 8.1.19 .Could someone get this to work? I can´t up to 8.2.6

Comments

  • The right click to repeat the last command only looks at regular commands (e.g. L, C, PL) etc. if you do define a function called c:myfunc in LISP then the command can be repeated if it is called via the command line as MYFUNC not (c:myfunc)steve

  • To repeat a lisp expression, you would have to press the Up arrow key and then Enter.

  • Maybe Pause is causing trouble - apparently it doesn't always work in V8.

  • I never used version 7, but I tried it just now to confirm that it does what Patrik says – i.e., that an Enter or Space Bar with no command typed before it repeats the last command OR the last lisp expression typed. I don't remember any version of Autocad working that way, so maybe it was removed for compatibility. But it seems like a good idea to me. I think they should restore it.Patrik, you said the update notes say it was supposed to be restored in v8.1.19. But I can't find where it says that. What's the wording you're looking at there?

  • As long as the function name is preceded by a C: (as it is in this example) it should be repeatable just like a native Command and always has in Autocad too.Mine are all repeatable (at least those without problems of their own) and made the transistion to V8.I think the only impediment is likely to be something in the routine which stops it from working properly or leaves Icad with an aversion to running it again unless it is reloaded. (for want of a better way of describing)The new lisp is better at telling you what went wrong.

  • A couple of things I see, the command requires a lisp parameter when it should probably be prompting for the path, second while the command should be repeatable and is, the lisp that was used to activate the command should not be, because that was not defined as a command.

    (DEFUN C:BLINS () (SETVAR "expert" 5) (IF (NOT *G_MYPATH*) (SETQ *G_MYPATH* "") ) (SETQ *G_MYPATH* (GETSTRING (STRCAT "\nPlease enter a path <" *G_MYPATH* ">: "))) (COMMAND ".insert" *G_MYPATH* PAUSE 1 1 PAUSE "expert" 0 "regenall") (PRINC))
  • Sorry !The code I used for years should start(defun blins ( fpath / )The C: support told me to add.That doesn´t work at all.What I want is a generic lisp that is called and added the blockname in the commandline so that I dont need a new lisp for every block.Place with one click rotate with next and skip the scale (set to 1).Repeatble on right_clickCheersPatrik

  • You probably don't want to let it beat you, but compared with typing the full name and path of a block, "insert" or "i" in V8 works pretty fast. An improvement on previous which wasn't bad either.

  • John !Thanks i works for repeating just slightly slower if you have a lot of blocks to place.I can live with this step "backwards".Patrik

  • I think everyone missed Patrik's original point, which was about a difference between v7 and v8.If you type this:: Line : (command "Arc"): v8 repeats Line, but v7 repeats Arc.The old way seems better. It might be useful when trying out things to use in a lisp program. But it's not a big deal, since v8 added the ability to recall anything with the Up arrow.

  • Oh. I didn't get that.I was disappointed in V8 because I used to have a lisp which used the arrow keys to issue a preset distance to Move, Copy etc & Pan. [UPARROW]@ (STRCAT "@0," PDIST). Just type "P", up/dn/l/rarrow to pan to the next floor plan of a building.Now I have to pick one of 8 options from a pull down menu (4 for panning, 4 for everything else).The new use for arrow keys reminds me of a utility called Doskey. Seemed neat at the time, but the novelty lasted about a week... like a dishwaher.

  • I used to pan with the arrow keys, too. That was nice. After wheel zooming and panning came in I lost interest in it. You could still do it with a macro processor.But I really like BricsCad's new arrow key scrolling. It's useful when programming. You can try out a function on the command line, then do something else, and then try the same function again.

  • Why not use a (WHILE (setq ppt(getpoint "Locate Insert:"))(setvar "expert" 5) (command insert fpath ppt ..... Then you wouldn't need to rt-click. Just a thought.

This discussion has been closed.