rog1n Posted May 21, 2020 Posted May 21, 2020 Hi, always when I search about a question I found rotines write by Lee Mac hehehe. I trying to insert a dynamic block with preset visibility so I used the code below ( LM:insertwithstate ( blk vis bse cmd def ent ext new obj pth rtn tmp ) ( pth ( ( blk)) ext ( (( blk)) ()) bse ( blk) ) ( ( pth) ( pth ( pth )) ) ( ( ( ( ( ( bse) ( blk bse) ) ( blk ( ( pth bse ext))) ) ) ( ( bse )) ) ( ( ( obj ( ( (LM:acdoc) ( ( 1 ( 'cvport)) 'paperspace 'modelspace ) ) 'insertblock '(0.0 0.0 0.0) blk 1.0 1.0 1.0 0.0 ) ) ( obj ) ( ( obj)) ) ( obj) ( ( bse )) ) ( ( (LM:setvisibilitystate obj vis)) ( obj) ( ( bse vis ) ) ) ( ( tmp 0) ( ( ( blk ( ( ( tmp ( tmp)))) ) ) ) ( ( ( (LM:acdoc) 'copyobjects ( obj) ( def ( ( (LM:acdoc)) 'add '(0.0 0.0 0.0) blk ) ) ) ) ) ( obj) ( ent () cmd ( 'cmdecho) ) ( 'cmdecho 0) ( ) ( ( ( blk 1.0 0.0 ) ( ( ent ( ent ()))) ( new ( ent)) ( ( new)) ) ( ( rtn ( ( new 'explode))) ( new) ) ) ( 'cmdecho cmd) ( ' ( def)) ) ) rtn ) ( LM:getvisibilityparametername ( blk vis ) ( ( ( blk 'effectivename) ( blk ( ( ( blk)) ( blk) ) ) ( ( blk)) ( ( blk)) ( vis ( '( ( pair ) ( ( ( 360 ( pair)) ( ( ( 0 ( ( pair)))) ) ) ( pair) ) ) ( ( ( blk)) ) ) ) ) ( ( 301 ( vis))) ) ) ( LM:SetVisibilityState ( blk val vis ) ( ( ( vis (LM:getvisibilityparametername blk)) ( ( val) ( ' (LM:getdynpropallowedvalues blk vis)) ) ) (LM:setdynpropvalue blk vis val) ) ) ( LM:acdoc ( ( ' 'LM:acdoc ' ( ()) ) ) (LM:acdoc) ) () () But I found a strange result, on Autocad 2018 when I insert a block the scale of block is set to: Scale X: 0.001, Scale Y: 0.001 and Scale Z: 0.001, but on Autocad Civil 3D 2018 the Scale are 1, anyone know why this happens? I attached a example of block this happens test.dwg Quote
Lee Mac Posted May 21, 2020 Posted May 21, 2020 (edited) That code looks to be seriously mutilated... Original posts here, here & here. As for your question, check the insertion units in your drawings. Edited May 21, 2020 by Lee Mac 1 Quote
rog1n Posted May 21, 2020 Author Posted May 21, 2020 (edited) On 5/21/2020 at 3:57 PM, Lee Mac said: That code looks to be seriously mutilated... Original posts here, here & here. As for your question, check the insertion units in your drawings. Thank you for you reply Lee, I got the exactly code from the first link (maybe my CTRL+C>CTRL+V to the forum bug the code). All drawing units are in meters. you can check below. Autocad 2018 Autocad Civil 3D 2018 edit: I found the problem on my Autocad 2018 the variable INSUNITSDEFTARGET was set to 4, thank you again Lee. Edited May 22, 2020 by rog1n 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.