Jump to content

Offset lines create diffrent layers and specify offset distence


Recommended Posts

Posted

your code is working perfect

check BIGAL code line type

 

ma.lin one file and all line types there

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • satishrajdev

    11

  • 121madhu

    7

  • Tharwat

    4

  • BIGAL

    2

Top Posters In This Topic

Posted Images

Posted

Change your LIN file according to following code :-

*TELECOM,TELECOM TELECOM TELECOM TELECOM TELECOM TELECOM TELECOM
A,.1,-.1,["TELECOM",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-25


*SPARE,SPARE line ----SPARE----SPARE----SPARE----SPARE----SPARE----SPARE--
A,.1,-.1,["SPARE",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-25


*STORM_WATER,STORM WATER line ----STORM WATER----STORM WATER----STORM WATER----STORM WATER----STORM WATER----STORM WATER--
A,.1,-.1,["STORM WATER",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-25


*MV_ELECTRICAL,MV ELECTRICAL line ----MV ELECTRICAL----MV ELECTRICAL----MV ELECTRICAL----MV ELECTRICAL----MV ELECTRICAL----MV ELECTRICAL--
A,.1,-.1,["MV ELECTRICAL",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-25


*ELECTRICITY,ELECTRICITY line ----ELECTRICITY----ELECTRICITY----ELECTRICITY----ELECTRICITY----ELECTRICITY----ELECTRICITY--
A,.1,-.1,["ELECTRICITY",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-25


*LANDSCAPING,LANDSCAPING line ----LANDSCAPING----LANDSCAPING----LANDSCAPING----LANDSCAPING----LANDSCAPING----LANDSCAPING--
A,.1,-.1,["LANDSCAPING",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-25


*IRRIGATION,IRRIGATION line ----IRRIGATION----IRRIGATION----IRRIGATION----IRRIGATION----IRRIGATION----IRRIGATION--
A,.1,-.1,["IRRIGATION",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-25 

and here is your modified lisp, but dont forget to put your desktop path....

 

(DEFUN C:TEST (/ A B C D)
 (VL-LOAD-COM)
 (SETVAR "cmdecho" 0)
 (WHILE (/= (SETQ A (GETSTRING "\nSpecify Name of New Layer :")) "")
   (SETQ B (CAR (ENTSEL "\nSelect Line to Offset :")))
   (INITGET 1)
   (SETQ C (GETDIST "\nSpecify Offset Distance :"))
   (SETQ D (GETPOINT "\nSpecify Point on Side to Offset :"))
   (IF    (NOT (TBLSEARCH "LTYPE" A))
     (COMMAND
   "-LINETYPE"
   "_L"
   A
   "C:\\Documents and Settings\\abc\\Desktop\\ma.lin"  [color=red][b];<- change this path[/b][/color]
   ""
      )
   )
   (VLA-ADD (VLA-GET-LAYERS
          (VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT))
        )
        A
   )
   (VLA-OFFSET
     (VLAX-ENAME->VLA-OBJECT B)
     (POINTSIDE B D)
   )
   (VLA-PUT-LINETYPE (VLAX-ENAME->VLA-OBJECT (ENTLAST)) A)
   (VLA-PUT-LAYER (VLAX-ENAME->VLA-OBJECT (ENTLAST)) A)
 )
 (SETVAR "cmdecho" 1)
 (PRINC)
)

Posted

yes its perfect thank you verry much satish

 

(DEFUN C:TEST (/ A B C D)
 (VL-LOAD-COM)
 (SETVAR "cmdecho" 0)
 (WHILE (/= (SETQ A (GETSTRING "\nSpecify Name of New Layer :")) "")
   (SETQ B (CAR (ENTSEL "\nSelect Line to Offset :")))
   (INITGET 1)
   (SETQ C (GETDIST "\nSpecify Offset Distance :"))
   (SETQ D (GETPOINT "\nSpecify Point on Side to Offset :"))
   (IF    (NOT (TBLSEARCH "LTYPE" A))
     (COMMAND
   "-LINETYPE"
   "_L"
   A
   "C:\Users\user\Desktop\\ma.lin"  ;
   ""
      )
   )
   (VLA-ADD (VLA-GET-LAYERS
          (VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT))
        )
        A
   )
   (VLA-OFFSET
     (VLAX-ENAME->VLA-OBJECT B)
     (POINTSIDE B D)
   )
   (VLA-PUT-LINETYPE (VLAX-ENAME->VLA-OBJECT (ENTLAST)) A)
   (VLA-PUT-LAYER (VLAX-ENAME->VLA-OBJECT (ENTLAST)) A)
 )
 (SETVAR "cmdecho" 1)
 (PRINC)
)
(DEFUN POINTSIDE (OBJ PNT / P1 PA P2)
 (SETQ    P1 (VLAX-CURVE-GETCLOSESTPOINTTO OBJ (TRANS PNT 1 0))
   PA (VLAX-CURVE-GETPARAMATPOINT OBJ P1)
 )
 (IF (EQUAL '(0.0 0.0 0.0)
        (VLAX-CURVE-GETSECONDDERIV OBJ PA)
        1e-8
     )
   (SETQ P1 (VLAX-CURVE-GETPOINTATPARAM OBJ (FIX PA))
     P2 (VLAX-CURVE-GETPOINTATPARAM OBJ (1+ (FIX PA)))
   )
   (SETQ P2 (MAPCAR '+ P1 (VLAX-CURVE-GETFIRSTDERIV OBJ PA)))
 )
 (IF (MINUSP (SIN (- (ANGLE P1 PNT) (ANGLE P2 PNT))))
   (SETQ C (- C))
   (SETQ C (+ C))
 )
)

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...