Extend code with extra plot functionality

Extend code with extra plot functionality

Marcelhoogteijling
Participant Participant
799 Views
4 Replies
Message 1 of 5

Extend code with extra plot functionality

Marcelhoogteijling
Participant
Participant
(vl-load-com)
(setq adoc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for layout (vla-get-layouts adoc)
  (if (/= (vla-get-name layout) "Model")
    (progn
    (vla-put-ShowPlotStyles layout :vlax-true)
    (vla-put-StyleSheet layout "lucht.ctb")
    )
    )
  )
(princ)

This script works perfect.

But, I like to extend the functionality of the script with:

- In the modelDisplay plotstyles has to be off.

- In the modelPlot style table has to be none.

 

Is there somebody who can adjust the code for me?

 

Kind regards Marcel

 

Here is the original post, because it's a solved post I opend this one.

Original post

0 Likes
Accepted solutions (1)
800 Views
4 Replies
Replies (4)
Message 2 of 5

pbejse
Mentor
Mentor
Accepted solution

@Marcelhoogteijling wrote:

...

But, I like to extend the functionality of the script with:

- In the modelDisplay plotstyles has to be off.

- In the modelPlot style table has to be none.

 


(vl-load-com)
(setq adoc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for layout (vla-get-layouts adoc)
  (setq data
	 (if (eq (vla-get-name layout) "Model")    	
	  '(0 "") '(-1 "lucht.ctb")
  	    )
	)
    (mapcar '(lambda (a b)
	       (vlax-put layout a b))  (list 'ShowPlotStyles 'StyleSheet) data)
    )
  
(princ)

HTH

 

0 Likes
Message 3 of 5

Sea-Haven
Mentor
Mentor

using original code

 

(vlax-for lay (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
(if (= (vla-get-name lay) "Model")
  (progn
  (vla-put-ShowPlotStyles lay :vlax-false)
  (vla-put-StyleSheet lay "")
  )
  (progn
  (vla-put-ShowPlotStyles lay :vlax-true)
  (vla-put-StyleSheet lay "Luch.ctb")
  )
)
)
0 Likes
Message 4 of 5

Marcelhoogteijling
Participant
Participant

Message 2 works perfect, thanks a lot

 

Kind regards Marcel

0 Likes
Message 5 of 5

Marcelhoogteijling
Participant
Participant

Message 3 doesn't work but the one before, Message 2, works fine.

So I'm happy.

 

Kind regards Marcel

0 Likes