Lisp to draw rectange on certain layer , on the layout viewports.

Lisp to draw rectange on certain layer , on the layout viewports.

MSA3DY
Contributor Contributor
316 Views
4 Replies
Message 1 of 5

Lisp to draw rectange on certain layer , on the layout viewports.

MSA3DY
Contributor
Contributor

Anybody can help in this lisp , I have a different layouts and had lot of details , I need to draw rectangles on all details , because I make viewports on the layer Defpoint (that is unseen in printing) .and i need this rectangle to be dotted.

0 Likes
317 Views
4 Replies
Replies (4)
Message 2 of 5

Kent1Cooper
Consultant
Consultant

[Don't make Viewports on the DEFPOINTS Layer.  You can find several discussions in the Forums about why that's a bad idea.  Make a Layer intended for Viewports, and set it to not plot.]

 

If you want their outlines to show as dotted, "standard" rectangular Viewport boundaries don't seem to honor non-continuous linetypes.  Make a Layer for them, and give it a dotted linetype.  If you can do all your Viewports with the Polygonal option in the -VPORTS command, or with the Object option using an existing Polyline, even if you make some or all of them rectangular, you can put them on a Layer with a non-continuous linetype, and that will be honored.

Kent1Cooper_0-1667827957602.png

 

Kent Cooper, AIA
Message 3 of 5

MSA3DY
Contributor
Contributor

I made a layer with dotted linetype, but when i draw viewports with this layer with ltscale adjusted , It still seems continuous.

0 Likes
Message 4 of 5

Kent1Cooper
Consultant
Consultant

@MSA3DY wrote:

I made a layer with dotted linetype, but when i draw viewports with this layer with ltscale adjusted , It still seems continuous.


How do you draw them?

 

It seems [in quickie experiment] that with a Viewport from command-line -VPORTS that is either based on the Object option or drawn with the Polygon option, adjusting the LTSCALE of the Viewport itself doesn't matter -- you need to adjust the LTSCALE of the basis object [likely a Polyline, but can be a Circle, etc.].  You may as well do it to both, anyway.

 

If drawn as a rectangle with the Single option in the VPORTS dialog box, or with the specify-corners default operation in -VPORTS, non-continuous linetype assignment doesn't have any effect, regardless of linetype scale.

 

EDIT:  This seems like a bug -- if one can use non-continuous linetypes for some Viewport boundaries, one should be able to for all of them, however they are drawn.  I have posted to that effect at the Product Feedback Page.

Kent Cooper, AIA
0 Likes
Message 5 of 5

Sea-Haven
Mentor
Mentor

Had same bug in Bricscad, as Kent suggested only continuous line, put the vport on "Non Plot" layer, only way to get dashed lines would be create a pline over top of vport. Try this.

 

 

(defun c:wow ( / e plent co-ord )
(setq e (entget (car (entsel "\nPick viewport "))))
(setq plent (entget (cdr (assoc 340 e))))
(setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) plent)))
(entmakex (append (list (cons 0 "LWPOLYLINE")
      (cons 100 "AcDbEntity")
     (cons 100 "AcDbPolyline")
     (cons 90 (length co-ord))
     (cons 6 "DASHED")
     (cons 48 50) ; ltscale
     (cons 70 1))
     (mapcar (function (lambda (p) (cons 10 p))) co-ord))
)
(princ)
)

 

0 Likes