Ajmal Posted May 4, 2020 Posted May 4, 2020 What is the problem? It's not working when am offsetting its not coming, (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq ilyrc(getstring(strcat "\Specify insulation layer <" (vl-princ-to-string ilyr)"> : "))) (setq layers (vla-get-Layers doc)) (setq ilyr (vla-Add layers ilyrc)) (setq plyr (vla-get-ActiveLayer doc))) (function (lambda (x) (vla-offset x (+ *ff)) (vla-put-layer (vlax-EName->vla-Object (entlast))plyr) (vla-offset x (+ iszo)) (vla-put-layer (vlax-EName->vla-Object (entlast))ilyr) (vla-offset x (- *ff)) (vla-put-layer (vlax-EName->vla-Object (entlast))plyr) (vla-offset x (- iszo)) (vla-put-layer (vlax-EName->vla-Object (entlast))ilyr))) Quote
Jonathan Handojo Posted May 4, 2020 Posted May 4, 2020 6 minutes ago, Ajmal said: (vla-put-layer (vlax-EName->vla-Object (entlast))plyr) Try: (vla-put-layer (vlax-EName->vla-Object (entlast)) ilyrc) Quote
Ajmal Posted May 4, 2020 Author Posted May 4, 2020 13 minutes ago, Jonathan Handojo said: Try: (vla-put-layer (vlax-EName->vla-Object (entlast)) ilyrc) It's working how can i put current layer like this Quote
Jonathan Handojo Posted May 4, 2020 Posted May 4, 2020 Any (vla-add...) you do to add an object (or even entmake really) will be drawn to the current layer by default, so you don't need to put vla-put-layer if you want the object to go to the current layer Quote
Ajmal Posted May 4, 2020 Author Posted May 4, 2020 "line" layer is "0" but current layer is "ajmal" vla-offset select line then it comming "0" layer but i need corrent layer (active layer)("ajmal") Quote
BIGAL Posted May 5, 2020 Posted May 5, 2020 Use tblsearch and check if layer exists then if not use vla-add or if exist (setvar 'clayer yourlayer) 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.