MacGyver13 Posted May 26 Posted May 26 Hello everyone I spent hours trying to solve this problem: I wrote a script that inserts and rotates 52 occurrences of block "aaa" in a 3d drawing. _insert aaa 0,0,0 1 1 10.8674180900849 _rotate3d (entlast) y 0,0,0 1.51506020498407 _insert aaa 0,0,0 1 1 10.3891249598048 _rotate3d (entlast) y 0,0,0 2.19061147912497 ... Block aaa is _inserted at origin and rotated 10.867° around z, then re-selected by (entlast) and _rotated 1.515° around y, and so on. It works fine: Then I changed the y rotation axis by defining 2 points. The new axis is parallel to y and crosses x axis: _insert aaa 0,0,0 1 1 10.8674180900849 _rotate3d (entlast) 50,0,0 50,10,0 1.51506020498407 _insert aaa 0,0,0 1 1 10.3891249598048 _rotate3d (entlast) 50,0,0 50,10,0 2.19061147912497 ... Problem: the result is not the same depending on what view is selected when I run the script. Result also changes if the zoom is not the same before running the script. Below is the result after running the same script in 3 different views (I hid the lines for clarity). Some blocks are not rotated correctly: All views use WCS (SCG in french). What am I doing wrong? Script and bloc "aaa" attached. Thanks in advance. equation of time.scr aaa.dwg Quote
BIGAL Posted May 27 Posted May 27 (edited) It may even be your osnaps causing problems use Osmode 0, not tested. Snap off also. Edited May 27 by BIGAL Quote
MacGyver13 Posted May 28 Author Posted May 28 You are the best, it works! I was far to imagine that a command with absolute coordinates could be disturbed by a graphical object snap mode. Note: grid snap doesn't cause any problem. Many thanks Quote
SLW210 Posted May 29 Posted May 29 I moved your thread to the The CUI, Hatches, Linetypes, Scripts & Macros Forum. 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.