Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Locked viewport command

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
sssteve72
542 Views, 3 Replies

Locked viewport command

^C^C-layer;m;VPORT;c;81;;p;n;VPORT;;_vports

 

^C^C-layer;m;VPORT;c;81;;p;n;$M=$(if,$(eq,$(getvar,tilemode),0),^C^C_-vports _p,^C^C^P(ai_viewports_alert)^P) 

 

A long time ago I had made a button with the above macro (actually there are two buttons there) to basically make a viewport and always put it in a specific layer with a specific color etc..  Well since then I've discovered I'd like to make that same viewport locked as part of the command so that when I initially draw the viewport it is locked.  I am not good with code and I know I didn't make that second one as that is way beyond me.

 

Is there a way to code a locked viewport without picking on it or typing in a name so that I basically click my command button and draw my viewport and when I am done everything in my macro up above is done and the viewport is locked?  Does anyone have anything like this ?

Custom Build with Win7 Pro 64Bit SP1
Gigabyte Tecohnology Co. X79-UD3
3.60 gigahertz Intel Core i7-3820
16GB GSkill Ripjaw Z PC3 2133 PC17000
PCI-E ATI FirePro V7800 2GB 256bit
ATA SanDisk SDSSDX24 SCSI Disk Device (256 GB)
Dell 2001FP, 2407WFPHC, ASUSVN289 in Triple monitor setup


Question - Are you the Common Denominator?
3 REPLIES 3
Message 2 of 4
scot-65
in reply to: sssteve72

A quick and dirty LISP...
(if (= (getvar "TILEMODE") 0)
(command ".VPORTS" "Lock" "On" (ssget "A" '((0 . "VIEWPORT"))) "")
)

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 3 of 4
smaher12
in reply to: sssteve72

The following will create your layer, with the viewport on that layer, and then lock the viewport...

 

^C^C-layer;m;VPORT;c;81;;p;n;VPORT;;VPORTS;\\VPORTS;LOCK;ON;LAST;;

Message 4 of 4
sssteve72
in reply to: smaher12

I couldn't get scot's to work (probably something I did wrong) but this one works great, thanks smaher12.
Custom Build with Win7 Pro 64Bit SP1
Gigabyte Tecohnology Co. X79-UD3
3.60 gigahertz Intel Core i7-3820
16GB GSkill Ripjaw Z PC3 2133 PC17000
PCI-E ATI FirePro V7800 2GB 256bit
ATA SanDisk SDSSDX24 SCSI Disk Device (256 GB)
Dell 2001FP, 2407WFPHC, ASUSVN289 in Triple monitor setup


Question - Are you the Common Denominator?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost