Jump to content

What's up with this???


drafter_joe

Recommended Posts

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 can place 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) "<180"))
 (command "move" "P" "" bpoint dist)
 (setvar "cmdecho" 1)
 (princ)
)

Link to comment
Share on other sites

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!

 

:lol: and :beer:

Edited by drafter_joe
After trying the _non osnap
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...