kaziko Posted February 18, 2016 Share Posted February 18, 2016 im working on several macros that allow you to click the ribbon button and start drawing a polyline on a specific layer. The issue I'm having is that the pline width for each macro needs to be different, without setting the default width. Basically I need the default width to stay at 0, and a pline from my macro to have a width of 1, when the macro is finished, the pline width should go back to 0 for future plines. This is what I have so far ^C^Cplinewid;1;-LAYER;S;"UNDERGROUND";^C^C;;_PLINE;\plinewid;0; This works as far as setting the pline width for that particular macro, however the plinewid;0; command at the end seems to not be functioning as the plinewid is remaining at 1. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 19, 2016 Share Posted February 19, 2016 My take on your task but using lisp in the ribbon this is the way I would do it in our menus. ^c^c(setvar "plinewid" 1)(setvar "clayer" "underground")(command "_pline")(while (= (getvar "cmdactive") 1 ) (command pause))(setvar "plinewid" 0) actually I would auto load this bit as you will repeat for the width ; create pline by picking points press enter when finished (defun PLAUTO ( ) (command "_pline") (while (= (getvar "cmdactive") 1 ) (command pause) ) ) ^c^c(setvar "plinewid" 1)(plauto)(setvar "plinewid" 0) a bit more ^c^c(plauto 1 "undergound") ^c^c(plauto 2 "undergound") ^c^c(plauto 3 "undergound") Quote Link to comment Share on other sites More sharing options...
kaziko Posted February 19, 2016 Author Share Posted February 19, 2016 Which one do I use? You gave me three different codes? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 19, 2016 Share Posted February 19, 2016 All of them ! This shows a couple of different methods you make a lisp plauto.lsp which has all the code in it hence the very simple (plauto 1 "underground") you would add plauto.lsp code to say acaddoc.lsp so it loads automatically. You can even run from command line just type (plauto 3 "ROADWAY") (defun PLAUTO ( width layname / ) (setvar "plinewid" width) (setvar "clayer" layname) (command "_pline") (while (= (getvar "cmdactive") 1 ) (command pause) ) (setvar "plinewid" 0) ) Quote Link to comment Share on other sites More sharing options...
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.