Jump to content

Please help to modified this lisp routine


CAD USER

Recommended Posts

Dear Users,

 

I have downloaded this Lisp, and it's work great, but i need some changes in this,

this Lisp draw duct in MLINE but i need it in line entity,

anybody can modified this lisp....

 

Thanks in advance...:)

Link to comment
Share on other sites

I've looked at the code, it's a real spaghetti.

 

Looks like it used to work drawing in polyline and all these sections

have been rem'd out.

 

Simply exploding the MLINES would give you LINES.

 

ymg

Link to comment
Share on other sites

So confirmed, in the body function the section that are rem'd out

will draw your duct run with straight section in LINE and elbow in LWPOLYLINE

instead of MLINE

 

Below I've rem'd out the MLINE and activated the LINE/LWPOLY mode.

There are two sections like this in the body function.

 

(if (and (= "Segmented" dpipeelb)
		  (not (equal ang1 ang2 0.000001))
	     )
	    (progn
	       ;(command "_.mline" "_st" "DUCT_PIPE" "_S" (cadar seglst) "_J" "_Z")
	       ;(mapcar 'command mllst)
	       ;(command "")
;-----------------------------------------------------------------------------------------------------------
                     (setvar "PLINEWID" 0.0)                                                              
                     (command "_.pline")                                                                  
                     (mapcar 'command ptLst)                                                              
                     (command "_c")                                                                       
                     (setq SegCnt 0)                                                                      
                     (while (< SegCnt (1- SegNum))                                                        
                        (command "_.line" (nth SegCnt ptlst) (nth (- (length ptlst) 3 SegCnt) ptlst) "")  
                        (setq SegCnt (1+ SegCnt))                                                         
                     )                                                                                    
                     (setvar "PLINEWID" dpipepWd)                                                         
;-----------------------------------------------------------------------------------------------------------
	    )
         )

 

For the elbows you will have to look around in the same function.

Might be a little more difficult as bulge are used for elbows in radius mode.

You could always explode the LWpolyline after it is drawn.

 

I attach the source code with the LWPoly mode activated.

 

ymg

ductlwp.LSP

Edited by ymg3
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...