Jump to content

Recommended Posts

Posted

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:

image.png.c9ef328721d63e9753b4921fc35b8062.png

 

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:

 

image.thumb.png.0020327e528bbbe7ab60677ece144c44.png

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

Posted (edited)

It may even be your osnaps causing problems use Osmode 0, not tested. Snap off also.

Edited by BIGAL
Posted

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

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...