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

drawing two difrent lines over eachother in one step

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
337 Views, 5 Replies

drawing two difrent lines over eachother in one step

I want to draw a line wich shows a particular colour scheme, I at current do this by drawing a solid line of one colour and then use a dashed line of another colour top go over it.

 

The obvious problem is that these lines are being double drawn.

 

Is there a way using lisp that I can draw both lines at once?

5 REPLIES 5
Message 2 of 6
_Tharwat
in reply to: Anonymous

Why both of them over eachother ? 

Do you mean that there is no space at all between both of them ?

 

Post a print sceen of your lines shapes .

Message 3 of 6
pbejse
in reply to: Anonymous


@Anonymous wrote:

I want to draw a line wich shows a particular colour scheme, I at current do this by drawing a solid line of one colour and then use a dashed line of another colour top go over it.

 

The obvious problem is that these lines are being double drawn.

 

Is there a way using lisp that I can draw both lines at once?


I sincerely hoping you create entities with Bylyaer properties:

 

(defun C:MDline ()
  (vl-load-com)
  (defun *error* (msg)
    (if (and msg
             (null (member msg '("Function cancelled" "quit / exit abort")))
        )
      (princ (strcat "\nError: " msg))
    )
    (setvar "clayer" cyl)
    (princ)
  )
  (setq cyl (getvar "clayer"))
  (setvar 'Clayer "YourFirstLine")
  (prompt "\nPick points:")
  (command "_Pline")
  (while (> (getvar "CMDACTIVE") 0) (command pause))
  (vla-put-layer
    (vla-copy (vlax-ename->vla-object (entlast)))
    "TheOtherLine"
    )
  (*error* nil)
  (princ)
  )

 

 

 

Wherein "YourFirstLine" is the layer for the first line (color/lineweight/linetype)

and "TheOtherLine" is the layer on top of the first line (color/linetype/linewieght)

 

<untested> codng by memory

 

HTH

 

EDIT: got rid of smileys

 

Message 4 of 6
_Tharwat
in reply to: Anonymous

OK ..... here is another using lines ....

 

(defun c:Test (/ p1 p2)
  (if (setq p1 (getpoint "\n First point :"))
    (while (setq p2 (getpoint p1 "\n Next point :"))
      (entmake (LIST '(0 . "LINE") (cons 10 p1) (cons 11 p2) (cons 8 (getvar 'clayer))))
      (entmake (LIST '(0 . "LINE") (cons 10 p1) (cons 11 p2) (cons 8 "0")))
      (setq p1 p2)
    )
    (princ)
  )
  (princ)
)

 

Message 5 of 6
Anonymous
in reply to: _Tharwat

Nice, I know it’s a bit of a wired request, but it’s for electrical schemas (colour coding)

 

I came up with some new information which was to use my MLSTYLE command and use a solid line of one colour @ and offset of 0 then use a broken line type (hidden or dashed ect) with the second colour also @ and offset of 0 the two lines function as one yet have two colours..

 

Now just a lisp to create an MLSTYLE and ill great 

Message 6 of 6
pbejse
in reply to: Anonymous


@Anonymous wrote:

Nice, I know it’s a bit of a wired request, but it’s for electrical schemas (colour coding)

 

@I came up with some new information which was to use my MLSTYLE command and use a solid line of one colour @ and offset of 0 then use a broken line type (hidden or dashed ect) with the second colour also @ and offset of 0 the two lines function as one yet have two colours..

 

Now just a lisp to create an MLSTYLE and ill great 


if he only differences is the color and linetype change the

(command "_PLine") to  (command "_Mline") on the code i posted

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost