drafter_joe 发表于 2022-7-5 16:56:12

What's up with this???

Hi All!
 
(Sorry for the long explanation, I hope it helps.)
I have this little routine that takes an object, testing with horizontal rectangles, makes a copy directly on top of the original, rotates it up 90 degrees, and then moves it over a certain distance to the left of the original.I have a formula based on the "dimscale" system variable multiplied by 2.The drafting standard here for text and dimensions is for every 12 inches of overall length of part, increase the text and dimension size by factor of 1.So if the part is 24" to 35" for it longest side, the dimscale would be 2, the text and dimension sizes would be doubled.My results have been, for example, on a 10" x 5" rectangle, it gets moved 2.5" instead of 2". On a 30" x 15" rectangle, it gets moved 7.5" instead of 4".I canplace a point at the lower left corner of the horizontal rectangle and using the data in the distance variable ("dist"), it will move it the proper distance.I don't know where the extra distance is coming from.How can it move the object 7.5" when the variable contains "@4.0   
If anyone can assist, I would greatly appreciate it!The code is below:
 

(defun c:cprt (/ bpoint dist) (setvar "cmdecho" 0) (setq factor (getvar "dimscale")) (setq bpoint "0,0") (setq obj (ssget "X" '((8 . "0")))) (command "copy" obj "" bpoint bpoint "") (command "rotate" "P" "" bpoint "90") (setq dist (* factor 2)) (setq dist (strcat "@" (rtos dist 2 1) "

Roy_043 发表于 2022-7-5 17:38:54

see:
https://www.theswamp.org/index.php?topic=51955.msg569852#msg569852

drafter_joe 发表于 2022-7-5 18:24:13

Thanks Roy_043!I took a quick look at the link you posted.Were you referring to the osnaps, or was it something else and I missed it?Just wondering.
 
It appears to be the osnap issue!Great shot Red 5!I mean Roy_043!
 
and
页: [1]
查看完整版本: What's up with this???