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

changing existing Mline or create new Mline

6 REPLIES 6
Reply
Message 1 of 7
waseemtarik
1291 Views, 6 Replies

changing existing Mline or create new Mline

hello everyone, after couple research I have got a way of doing a half hidden-line and half solid line in one elements.

as I don't like to work with lines or make it dynamic block. however now I have to change all of my frames to be half hidden half solid, I have got some lisps but still I'm missing something to have it the way I wanted to be. please have a look at the CAD file and the lisp that is attached and advise me of how to do it. because when I'm applying the lisp is doesn't make it as half solid half hidden.

please let me know if I have to provide more information and details.

 

in somehow one of the lisps I can't upload it so I will provide the link of it's source.

 

https://www.cadforum.cz/cadforum_en/download.asp?fileID=670

 

thanks

6 REPLIES 6
Message 2 of 7
Sea-Haven
in reply to: waseemtarik

This creates mlines in answer to another post recently, I changed the linetype to "DASHED2" DXF 6, dxf 8 is layer, 62 color, 74 use 4, 8 or 12. The method could be expanded to read 3 values offset,color,linetype for each line. Will try to find time to add multi offsets see image.

 

 

 

 

; make mline 
; By alan H oct 2020
; Set to bylayer at moment
; Thanks to FIXO for original code

(defun c:makml ( / lst1 lst2 lst desc MLINE_STYLE_NAME )
(setq 	MLINE_STYLE_NAME (getstring "\nEnter mline name ")
		desc (getstring "\nEnter description ")
)
(while (setq off (getreal "\Enter offset Enter to finish " ))
	(setq lst (cons off lst))
)
(if (= desc nil)(setq desc MLINE_STYLE_NAME))
(setq lst1
	(list '(0 . "MLINESTYLE")
		'(100 . "AcDbMlineStyle")
		(cons 2 MLINE_STYLE_NAME)
		'(70 . 0)
		(cons 3 desc)
		'(62 . 256)
		'(51 . 1.5708)
		'(52 . 1.5708)
		'(71 . 4)
	)
)
(setq x (length lst))
(repeat x
	(setq lst2 (list 
		(cons 49 (nth (setq x (- x 1)) lst))
		(cons 62 256)
		(cons 6 "DASHED2")
		)
	)
	(setq lst1 (append lst1 lst2))
)

(if
	(not (dictadd
		(cdar (dictsearch (namedobjdict) "ACAD_MLINESTYLE"))
		MLINE_STYLE_NAME
		(entmakex lst1)
		)
	)
	(Alert "Impossible to create mline style\n perhaps this was exist earlier")
)
(setvar 'cmlstyle MLINE_STYLE_NAME)
(princ)
)
(c:makml)

 

 

 

Message 3 of 7

Neither the PL2ML nor the change_mline does what you need. If you want to change the style of an existing multiline, you will need to edit it in the MLSTYLE dialog and the style must not be used in the current drawing (the definitions are stored in the ACAD.MLN file in your support folder).

 

Vladimir Michl, www.cadstudio.cz - www.cadforum.cz

 

Message 4 of 7
waseemtarik
in reply to: Sea-Haven

@Sea-Havencould you please provide a screen-video.

@vladimir_michlI already have the frames all drawn and can't be redrawn again, however that's why I uploaded these lisp so someone can modify it. thanks

Message 5 of 7
Sea-Haven
in reply to: waseemtarik

The code makes a Mline with linetype set to layer just load it and enter offsets 1 2 3 press Enter to stop and a name then its available for use with mline 

Message 6 of 7
waseemtarik
in reply to: Sea-Haven

@Sea-Haven sorry, but could work, if you could please upload a screen-video I would really appreciate that. 

thanks 

Message 7 of 7
Sea-Haven
in reply to: waseemtarik

"just load it and enter offsets 1 2 3 press Enter to stop and a name & description"

 

Mline ST enter name, start picking points.

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report