Results 1 to 9 of 9

Thread: Using MLine in lisp

  1. #1
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    385
    Login to Give a bone
    0

    Default Using MLine in lisp

    Hello all,
    I am trying to use Mline in my lisp routine. Lets just say it so far look ssmething like this

    (defun c:cool (/ currlay)
    (setq currlay (getvar "clayer"))
    (c:mline)
    (setvar "clayer" currlay)
    (princ "thanks all"))

    thank you all in advance,
    Andre

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Using MLine in lisp

    What do you want to do with the mline?
    Are you just trying to create it or do something with it?

  3. #3
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    385
    Login to Give a bone
    0

    Default Re: Using MLine in lisp

    really just trying to create it then explode it into just lines

    looks a little closer to this


    (defun c:ddcf ()
    (setq currlay (getvar "clayer"))
    (setq scale (getdist "Scale: "))
    (command "mline" "s" scale "j" "z" "")
    (c:mline)
    (command "explode" (entlast) "")
    (princ))

    Thansk in advance again
    Andre

  4. #4
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Thumbs up Re: Using MLine in lisp

    Well I got further with it.
    this only allows you to pick 2 points for your mline.

    Code:
    (defun c:ddcf ()
    (setq currlay (getvar "clayer"))
    (setq scale (getdist "Scale: "))
    (SETQ lr1 (TBLSEARCH "LAYER" "MLINE"))	  
    		(IF (= LR1 NIL)	
    		(COMMAND "LAYER" "MAKE" "MLINE" "COLOR" "4" "" ""))
    (command "layer" "set" "mline" "" "")
    (command "mline" "scale" scale "style" "" pause pause pause "")
    (command "explode" (entlast) "")
    (setvar "clayer" currlay)
    (princ))
    I'll look into being able to pick more points.
    Are you going to close it like a polyline?

    I'll bet there's gurus out there who can improve on it!

  5. #5
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    385
    Login to Give a bone
    0

    Default Re: Using MLine in lisp

    no, I dont plan on closing it, its more right now for pipe routing lines taht I want to stay a set distance apart.

  6. #6
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Using MLine in lisp

    Quote Originally Posted by ReachAndre
    no, I dont plan on closing it, its more right now for pipe routing lines taht I want to stay a set distance apart.
    Ok, here's another vesion.
    It uses points you pick on the screen using "blipmode", I got it from another routine I have.
    The problem is you can't use ortho [F8] in this, or atleast I don't know how yet.
    Code:
    (defun c:ddcf (/ pts currlay)
    		(setq blips (getvar "blipmode"))
    		   (setq currlay (getvar "clayer"))
    	(setq scale (getdist "Scale: "))
    		(SETQ lr1 (TBLSEARCH "LAYER" "MLINE"))	  
    		(IF (= LR1 NIL)	
    		(COMMAND "LAYER" "MAKE" "MLINE" "COLOR" "4" "" ""))
    	(command "layer" "set" "mline" "" "")
    		(command "blipmode" "on")
    		(setq pts ())
    
    	   (while
    		(setq pt (getpoint "\nSelect Point:"))
    		(setq pts (cons pt pts))
    	   )
    		(command "mline" )
    		(foreach item pts
    				(command item)
    	   )
    	   
    		(command "") 
    (setvar "blipmode" blips)
    		(command "redraw")
    (command "explode" (entlast) "")
    (setvar "clayer" currlay)
    		(setq pts_l(length pts))
    		(setq msg (strcat "\nProcessed "(itoa pts_l)"Points:"))
    )
    But you can pick as many points on the screen you want.
    Hope this helps or steers you in the right direction.

  7. #7
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    487
    Login to Give a bone
    0

    Question Re: Using MLine in lisp

    ??? Why are you explode the mline ???

  8. #8
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    385
    Login to Give a bone
    0

    Default Re: Using MLine in lisp

    The only reason I am exploding the mline is because of company standard not being mlines. Not my call, but I dont have that much clout here yet.

  9. #9
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    487
    Login to Give a bone
    0

    Default Re: Using MLine in lisp

    Quote Originally Posted by ReachAndre
    The only reason I am exploding the mline is because of company standard not being mlines. Not my call, but I dont have that much clout here yet.
    be for mline autocad had a list program call DLINE that dose what your are trying to do look he

    http://www.autocadtrainerguy.com/Aut...toCADStuff.htm

Similar Threads

  1. Editing MLINE with lisp
    By cadconcepts in forum AutoLISP
    Replies: 0
    Last Post: 2013-02-05, 09:22 PM
  2. mline
    By bfish2 in forum AutoCAD General
    Replies: 3
    Last Post: 2009-12-08, 12:17 AM
  3. Better MLINE Editing
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 4
    Last Post: 2005-10-10, 02:23 PM
  4. question of mline
    By malihan_ph in forum AutoLISP
    Replies: 5
    Last Post: 2005-08-11, 05:07 PM
  5. Using Mline in a lisp routine
    By jawf in forum AutoLISP
    Replies: 5
    Last Post: 2005-08-02, 04:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •