mhupp Posted March 19, 2023 Posted March 19, 2023 (edited) This should do it limited testing. tho i think the z shows up backwards. -edit moved file to latest post. Edited March 21, 2023 by mhupp Quote
russ079 Posted March 19, 2023 Author Posted March 19, 2023 Thanks. I have just tried it, but the x y z all come up as 00 and it asks me to manually enter the attributes. Could this be the setup of my autocad or the dwg file? Quote
mhupp Posted March 19, 2023 Posted March 19, 2023 (edited) Works for me. but updated the code above to Z is now shown in the right direction. moved the insert command outside the setq. added an error check to see if both points are picked. Edited March 19, 2023 by mhupp Quote
russ079 Posted March 20, 2023 Author Posted March 20, 2023 What version are you using ? Is it autocad or BricsCad ? From the command line it looks like the problem is when it is trying to insert the value to the block, it shows a command of just "2.6" and says unknown command. Quote
mhupp Posted March 20, 2023 Posted March 20, 2023 Might need an empty "" after the "0" to exit the insert command. from (command "-INSERT" blnam "_S" cmp:scal ptb "0" (rtos ... to (command "-INSERT" blnam "_S" cmp:scal ptb "0" "" (rtos ... Quote
BIGAL Posted March 20, 2023 Posted March 20, 2023 Check also ATTREQ it controls wether it allows for entry of attributes. 1 Quote
russ079 Posted March 20, 2023 Author Posted March 20, 2023 Ive tried with ATTREQ set to 1 & 0, but neither works. Also tried added "" but still no luck. I dont understand why it works on your PC fine. Ive tried on 2 different autocads and neither work. Quote
BIGAL Posted March 20, 2023 Posted March 20, 2023 (edited) What happens if you use this with scale hard set (command "-INSERT" blnam "_S" 5 ptb "0" (rtos (abs (* (car deval) 1.0)) 2 1) (rtos (abs (* (cadr deval) 1.0)) 2 1) (rtos (* (caddr deval) -1.0) 2 1)) That would suggest something wrong with cmp:scal I redid the IF as the 5 is hard coded any way. (setq *cmp:scal 5) (setq cmp:scal (getreal (strcat "\nSpecify tags scale < 5 >: "))) (if (= cmp:scal nil) (setq cmp:scal *cmp:scal) ) This may affect further into code for me your welcome to use my Multi radio buttons. Can preset which is most commonly used and set it to last picked when ran again. Edited March 20, 2023 by BIGAL Quote
russ079 Posted March 20, 2023 Author Posted March 20, 2023 Quote (command "-INSERT" blnam "_S" 5 ptb "0" (rtos (abs (* (car deval) 1.0)) 2 1) (rtos (abs (* (cadr deval) 1.0)) 2 1) (rtos (* (caddr deval) -1.0) 2 1)) I tried replacing the above line but still no look. My drawings are scale 1:1 - 1 unit = 1mm Quote
thecocuk07 Posted March 20, 2023 Posted March 20, 2023 (edited) 9 hours ago, russ079 said: ATTREQ 1 & 0'a ayarlıyken denedim ama ikisi de çalışmıyor. Ayrıca "" eklemeyi denedim ama yine de şans yok. PC'nizde neden iyi çalıştığını anlamıyorum. 2 farklı autocad denedim ve ikisi de işe yaramadı. hello, it didn't work for me either Edited March 20, 2023 by thecocuk07 Quote
russ079 Posted March 20, 2023 Author Posted March 20, 2023 Are you on autocad 2020? Im not sure if its anything to do with version of autocad or windows, read before about a different lisp that would only work on x86 not 64bit but unsure why. Just seems odd how it works on mhupp pc fine, just not sure what the difference is. Quote
thecocuk07 Posted March 20, 2023 Posted March 20, 2023 1 minute ago, russ079 said: Are you on autocad 2020? Im not sure if its anything to do with version of autocad or windows, read before about a different lisp that would only work on x86 not 64bit but unsure why. Just seems odd how it works on mhupp pc fine, just not sure what the difference is. yes , autocad 2020 and win 10 64bit Quote
mhupp Posted March 21, 2023 Posted March 21, 2023 looked over the old list for the layers they had some other variables set so added those except for osmode. see if that works. if this doesn't work your going to have to type out the insert command and look at what AutoCAD wants. this is what BricsCAD uses. (command "-INSERT" blnam "_S" cmp:scal ptb "0" (rtos (abs (* (car deval) 1.0)) 2 1) (rtos (abs (* (cadr deval) 1.0)) 2 1) (rtos (* (caddr deval) -1.0) 2 1)) : -INSERT ? to list blocks in drawing/~ to open the file dialog/<Block to insert> <Compare_RT>: Compare_RT Units: Unitless Conversion: 1" Insertion point for block or [Multiple blocks/Scale]:_S Scale factor for block: 2 Insertion point for block or [Multiple blocks/Scale]: Rotation angle for block <0>: 0 Delta x <00>: 8 Delta y <00>: 2 Delta z <00>: 2 Quote
russ079 Posted March 21, 2023 Author Posted March 21, 2023 How would I set it to loop after the tag scale is set? Can I add in a while function after the tag scale is set ? Quote
thecocuk07 Posted March 21, 2023 Posted March 21, 2023 4 hours ago, mhupp said: looked over the old list for the layers they had some other variables set so added those except for osmode. see if that works. if this doesn't work your going to have to type out the insert command and look at what AutoCAD wants. this is what BricsCAD uses. (command "-INSERT" blnam "_S" cmp:scal ptb "0" (rtos (abs (* (car deval) 1.0)) 2 1) (rtos (abs (* (cadr deval) 1.0)) 2 1) (rtos (* (caddr deval) -1.0) 2 1)) : -INSERT ? to list blocks in drawing/~ to open the file dialog/<Block to insert> <Compare_RT>: Compare_RT Units: Unitless Conversion: 1" Insertion point for block or [Multiple blocks/Scale]:_S Scale factor for block: 2 Insertion point for block or [Multiple blocks/Scale]: Rotation angle for block <0>: 0 Delta x <00>: 8 Delta y <00>: 2 Delta z <00>: 2 Thank you for your efforts and interest. 1 Quote
thecocuk07 Posted March 21, 2023 Posted March 21, 2023 Repeated operations to remember the scale factor; i did something like this but i guess it's wrong (if (= *cmp:scal nil) (setq *cmp:scal 5)) ;set your most used scale here. (initget 2) (setq cmp:scal (getreal (strcat "\nSpecify tags scale <" (rtos *cmp:scal) ">: ")) (if (= cmp:scal nil)(setq cmp:scal *cmp:scal)) (progn) (setq *cmp:scal cmp:scal) ) Quote
russ079 Posted March 21, 2023 Author Posted March 21, 2023 I have just tried on another drawing, it is working good. Only small issue is after comfirming tag scale, my point style changes and goes small on the screen. After the lisp it complete it goes back to my set point style of 25 units. Is there anyway the tag scale can be set without affecting the point style settings ? Quote
russ079 Posted March 21, 2023 Author Posted March 21, 2023 Just recorded what happens as above in my previous post, if any one could advise what is causing it to change. https://www.dropbox.com/s/sjskjm2cbwn6k6u/cmp.mp4?dl=0 Quote
russ079 Posted March 21, 2023 Author Posted March 21, 2023 I have figured out how to stop the point size changing. It was set to change the pdsize to 0.15, so updated to 25 and all good now. ) (setq vars '(cmdecho attdia attreq pdsize INSUNITS) ;list of variables vals (mapcar 'getvar vars) ;store old values ) (mapcar 'setvar vars '(0 0 1 0.15 0)) ;set new values 1 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.