KiLLiNG-TiME Posted September 11, 2013 Share Posted September 11, 2013 A little help if possible, Does anybody know how to change the VP (viewport) colour of a layer by script or if its even possible. Regards KT p.s or lsp of course. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted September 11, 2013 Share Posted September 11, 2013 It appears that you'll have to dig into a LayerTableRecord's Extension Dictionary's XRecord for this. Cheers Quote Link to comment Share on other sites More sharing options...
KiLLiNG-TiME Posted September 11, 2013 Author Share Posted September 11, 2013 It appears that you'll have to dig into a LayerTableRecord's Extension Dictionary's XRecord for this. Cheers Thank you, just what I didn't want to hear Quote Link to comment Share on other sites More sharing options...
BlackBox Posted September 11, 2013 Share Posted September 11, 2013 Yeah, sorry... I got hit up for something, and posted quickly... Try this: (defun c:FOO (/ eName layerName color) (if (or (and (setq eName (car (entsel "\nSelect entity to change VP color: ")) ) (setq layerName (cdr (assoc 8 (entget eName)))) ) (and (setq layerName (getstring T "\nEnter layer name to change VP color: " ) ) (tblsearch "layer" layerName) ) ) (if (setq color (acad_colordlg (if (= "BYLAYER" (setq color (getvar 'cecolor))) 256 color ) ) ) (command "._vplayer" "_color" color layerName pause "") ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
steven-g Posted September 11, 2013 Share Posted September 11, 2013 You could use a script, at least what I understand to be a script (LT mentality) vplayer color RED NameOfLayer current the script should be finished with 2 presses of the enter key, and the script called up whilst a viewport is active. The color should be changed to suit and can include true color. Quote Link to comment Share on other sites More sharing options...
KiLLiNG-TiME Posted September 12, 2013 Author Share Posted September 12, 2013 (edited) Thank you both BlackBox & Steven-g I shall give both methods a go, much appreciated. I though I knew AutoCAD quite well but I never knew there was a VPlayer command , thanks again for that one. Edited September 12, 2013 by KiLLiNG-TiME Quote Link to comment Share on other sites More sharing options...
RobDraw Posted September 12, 2013 Share Posted September 12, 2013 Don't know where I got this but use it quite often. (defun c:lc (/ clr lay) (vl-load-com) (setq lay (cdr (assoc 8 (entget (car (entsel "\nSelect object to change layer color: ")) ) ) ) clr (acad_colordlg 1) ) (if (and lay clr) (vla-put-color (vlax-ename->vla-object (tblobjname "layer" lay)) clr ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
KiLLiNG-TiME Posted September 12, 2013 Author Share Posted September 12, 2013 Thank you Rob another one to try lsp wise. The script is quite easy now that I know the VPLAYER command & works a treat. Many thanks all for help. Quote Link to comment Share on other sites More sharing options...
samifox Posted June 7, 2016 Share Posted June 7, 2016 im running a script ^C^Cvplayer color 8 * Select how can i pause it for user selection? for example i want to type the color index instead of fixed 8. Quote Link to comment Share on other sites More sharing options...
KiLLiNG-TiME Posted June 8, 2016 Author Share Posted June 8, 2016 (edited) im running a script ^C^Cvplayer color 8 * Select how can i pause it for user selection? for example i want to type the color index instead of fixed 8. You uses a backslash (\) at the point where you want to manually input. Found a link for you https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2017/ENU/AutoCAD-LT/files/GUID-9D921CDD-89A3-44AB-865A-00F8986611F2-htm.html Edited June 8, 2016 by KiLLiNG-TiME updating 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.