121madhu Posted December 3, 2013 Posted December 3, 2013 1. In utilities need offset the line 2m. and 1.5m and 4m….etc. Every line create the new layer (new layer name user defined ) no need color. 2. the layer name I defined as the line type Example:- layer name: MV Electrical (---MV Electrical---MV Electrical---MV Electrical---MV Electrical---) And how much distance between the text also user defined No need line between text to text Thanks I am sorry for my poor English Quote
BIGAL Posted December 3, 2013 Posted December 3, 2013 Please post a example dwg or image. To have different spacing of the text would mean that it is not a line type but text and lines, you can though create the smae linetype many times with different text spacing. *WATER_MAIN,Water main ----W----W----W----W----W----W-- A,40,-4.0,["W",STANDARD,S=1.8,R=0.0,X=-1.8,Y=-2.0],-4 *WATER_MAIN2,Water main2 ----W----W----W----W----W----W-- A,20,-5.08,["W",STANDARD,S=1.8,R=0.0,X=-1.8,Y=-.9],-3 Quote
satishrajdev Posted December 4, 2013 Posted December 4, 2013 TRY THIS :- *Give offset distance in + or - according to your offset direction. (DEFUN C:TEST (/ A B C) (VL-LOAD-COM) (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 :")) (VLA-ADD (VLA-GET-LAYERS (VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT)) ) A ) (VLA-OFFSET (VLAX-ENAME->VLA-OBJECT B) C ) (VLA-PUT-LAYER (VLAX-ENAME->VLA-OBJECT (ENTLAST)) A) ) (PRINC) ) Quote
Tharwat Posted December 4, 2013 Posted December 4, 2013 Satish , do you know that the getstring function with enter means not nil value ? Quote
satishrajdev Posted December 4, 2013 Posted December 4, 2013 Oops... i didnt realise that.... how to avoid that Tharwat Quote
Tharwat Posted December 4, 2013 Posted December 4, 2013 Oops... i didnt realise that.... how to avoid that Tharwat You can add the operator (not equal to [/=] or (not (eq .....))) to avoid THAT. Quote
satishrajdev Posted December 4, 2013 Posted December 4, 2013 SOMETHING LIKE THIS ???? (DEFUN C:TEST (/ A B C) (VL-LOAD-COM) (WHILE (WHILE (OR (= A NIL) (= A "")) (SETQ A (GETSTRING "\nSpecify Name of New Layer :")) ) (SETQ B (CAR (ENTSEL "\nSelect Line to Offset :"))) (INITGET 1) (SETQ C (GETDIST "\nSpecify Offset Distance :")) (VLA-ADD (VLA-GET-LAYERS (VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT)) ) A ) (VLA-OFFSET (VLAX-ENAME->VLA-OBJECT B) C ) (VLA-PUT-LAYER (VLAX-ENAME->VLA-OBJECT (ENTLAST)) A) ) (PRINC) ) Quote
satishrajdev Posted December 4, 2013 Posted December 4, 2013 SOMETHING LIKE THIS ???? (DEFUN C:TEST (/ A B C) (VL-LOAD-COM) (WHILE (WHILE (OR (= A NIL) (= A "")) (SETQ A (GETSTRING "\nSpecify Name of New Layer :")) ) (SETQ B (CAR (ENTSEL "\nSelect Line to Offset :"))) (INITGET 1) (SETQ C (GETDIST "\nSpecify Offset Distance :")) (VLA-ADD (VLA-GET-LAYERS (VLA-GET-ACTIVEDOCUMENT (VLAX-GET-ACAD-OBJECT)) ) A ) (VLA-OFFSET (VLAX-ENAME->VLA-OBJECT B) C ) (VLA-PUT-LAYER (VLAX-ENAME->VLA-OBJECT (ENTLAST)) A) ) (PRINC) ) Quote
Tharwat Posted December 4, 2013 Posted December 4, 2013 This is enough ... (while (/= (setq A (getstring "\n Specify Name of New Layer :")) "") ..... Quote
121madhu Posted December 4, 2013 Author Posted December 4, 2013 thank you satish & tharwat my request specify which side offset and continue this lisp when i press Esc. another one is line type Quote
satishrajdev Posted December 4, 2013 Posted December 4, 2013 Your welcome, But I didn't get what you said next, what you want to do exactly....specify clearly or give example Quote
satishrajdev Posted December 5, 2013 Posted December 5, 2013 Try this :- (DEFUN C:TEST (/ A B C D) (VL-LOAD-COM) (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 :")) (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-LAYER (VLAX-ENAME->VLA-OBJECT (ENTLAST)) A) ) (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)) ) ) Quote
121madhu Posted December 5, 2013 Author Posted December 5, 2013 yes i am looking this its works perfect thank you very much satish. i am create this line-type and loaded *TELECOMLINE,TELECOM TELECOM TELECOM TELECOM TELECOM TELECOM TELECOMA,.1,-.1,["TELECOM",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-25 *SPARE_LINE,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_LINE,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_LINE,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_LINE,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_LINE,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_LINE,IRRIGATION line ----IRRIGATION----IRRIGATION----IRRIGATION----IRRIGATION----IRRIGATION----IRRIGATION-- A,.1,-.1,["IRRIGATION",STANDARD,S=.1,R=0.0,X=-0.1,Y=-.05],-25 example:- when i offset line layer name:- TELECOM so my line type in layer also telecom its possible or not Quote
satishrajdev Posted December 5, 2013 Posted December 5, 2013 Have you created your linetype of your own...if yes then where have you save that.... Quote
BIGAL Posted December 6, 2013 Posted December 6, 2013 Just need to add this line as well (VLA-PUT-LINETYPE (VLAX-ENAME->VLA-OBJECT (ENTLAST)) A) Quote
121madhu Posted December 7, 2013 Author Posted December 7, 2013 Have you created your linetype of your own...if yes then where have you save that.... yes and save my desktop name ma.lin (VLA-PUT-LINETYPE (VLAX-ENAME->VLA-OBJECT (ENTLAST)) A) error massage coming :; error: Automation Error. Key not found Quote
satishrajdev Posted December 7, 2013 Posted December 7, 2013 Have you created *.lin file for every linetype or in that ma.lin file only all linetypes are available??? error massage coming :; error: Automation Error. Key not found Is it coming from my code???? Quote
Recommended Posts
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.