Ajmal Posted May 4, 2020 Share 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 Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted May 4, 2020 Share 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 Link to comment Share on other sites More sharing options...
Ajmal Posted May 4, 2020 Author Share 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 Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted May 4, 2020 Share 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 Link to comment Share on other sites More sharing options...
Ajmal Posted May 4, 2020 Author Share 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 Link to comment Share on other sites More sharing options...
BIGAL Posted May 5, 2020 Share Posted May 5, 2020 Use tblsearch and check if layer exists then if not use vla-add or if exist (setvar 'clayer yourlayer) Quote Link to comment Share on other sites More sharing options...
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.