masterfal Posted February 14, 2020 Posted February 14, 2020 Hi All, I have a lisp routine set up where when i type the command and then choose a polyline, it will modify this polyline to have a set thickness. It doesn't work on normal lines though. I have to use a different routine to change a line into a polyline before it sets the thickness Is it possible to set up so that the same command can work on both lines or polylines? And Is it also possible to specify a layer to put this polyline onto? I'd like to make it so typing B1 will make a polyline with width of 50 in a layer called _beams (defun c:b1 () (command "pedit" pause "w" "50" "")) Quote
BIGAL Posted February 14, 2020 Posted February 14, 2020 (edited) I have a lisp that I am trying to work out the last step it allows you to do any width by type P23 ie a pline 23 wide you can type P plus any number. It makes a new pline with a width but you could edit it and do a is it a line or a pline then pedit the entity. For any one interested see code attached problem is in color option. What about something like this. The multi getvals can be changed so it remembers the layer and width. (defun c:pedwid ( / ans entis lay wid ) (while (setq ent (car (entsel "\nPick an object to make pline width:"))) (setq entis (cdr (assoc 0 (entget ent)))) (if (not AH:getvalsm)(load "Multi Getvals.lsp")) (setq ans (AH:getvalsm (list "Please choose" "layer name " 25 24 "Your layer name" "Width " 8 7 "20" ))) (setq lay (nth 0 ans)) (setq wid (atof (nth 1 ans))) (cond ((= entis "LINE")(command "Pedit" ent "Y" "w" wid "")) ((= entis "ARC")(command "Pedit" ent "Y" "w" wid "")) (if (= entis "LWPOLYLINE")(command "Pedit" ent "w" wid "")) ((Alert "Object chosen can not be made into a pline")) ) (command "chprop" (entlast) "" "LA" lay "") ) (princ) ) (c:pedwid) Multi GETVALS.lsp pline arc offset.lsp Edited February 17, 2020 by BIGAL Quote
masterfal Posted February 14, 2020 Author Posted February 14, 2020 thats pretty cool. converts to polyline with thickness but doesn't seem to want to change layer? just puts it in whatever the current layer is Quote
BIGAL Posted February 14, 2020 Posted February 14, 2020 Will double check, do you need remember layer and width ? Quote
masterfal Posted February 14, 2020 Author Posted February 14, 2020 can it be set up so skips the prompt to input thickness & layer name? i only need it to do 3 different thicknesses 50, 100, 200 and all in same layer (_beams) Was hoping to get it set up with 3 different commands that changes the line to those actual widths B1 would be 50 thick in _beams layer B2 would be 100 thick in _beams layer B3 would be 200 thick in _beams layer Quote
BIGAL Posted February 14, 2020 Posted February 14, 2020 (edited) Try this (defun c:b1 ( /) (pedwid 50.0 "_beams layer")) (defun c:b2 ( /) (pedwid 100.0 "_beams layer")) (defun c:b3 ( /) (pedwid 200.0 "_beams layer")) (defun pedwid (wid lay / entis ) (while (setq ent (car (entsel "\nPick an object to make pline width:"))) (setq entis (cdr (assoc 0 (entget ent)))) (cond ((= entis "LINE")(command "Pedit" ent "Y" "w" wid "")) ((= entis "ARC")(command "Pedit" ent "Y" "w" wid "")) (if (= entis "LWPOLYLINE")(command "Pedit" ent "w" wid "")) ((Alert "Object chosen can not be made into a pline")) ) (command "chprop" (entlast) "" "LA" lay "") ) (princ) ) Edited February 17, 2020 by BIGAL 1 Quote
masterfal Posted February 17, 2020 Author Posted February 17, 2020 thanks for having a look. when i try this it it only lets me select 1 line at a time and after choosing the line i have press enter a couple of times to end the command. anyway to get around those things? Quote
BIGAL Posted February 17, 2020 Posted February 17, 2020 Sorry did not test, I left the exit CHPROP off (command "chprop" (entlast) "" "LA" lay "" ) Quote
masterfal Posted February 17, 2020 Author Posted February 17, 2020 ahh i was so close.. i was adding the additional "" at the ends of the lines below instead of where you showed to add it ((= entis "LINE")(command "Pedit" ent "Y" "w" wid "")) ((= entis "ARC")(command "Pedit" ent "Y" "w" wid "")) (if (= entis "LWPOLYLINE")(command "Pedit" ent "w" wid "")) Quote
masterfal Posted February 17, 2020 Author Posted February 17, 2020 ahhhh damn it. may have done this for nothing.. didn't realise thick polylines don't print out the same as a solid shade even though they look identical on screen.. is this normal? on screen: print: Quote
BIGAL Posted February 17, 2020 Posted February 17, 2020 Never had a problem is the pline a linetype other than continuous ? What are you plotting to ? Maybe others have seen this problem. Quote
Roy_043 Posted February 18, 2020 Posted February 18, 2020 Maybe the OP uses STB instead of CTB? 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.