Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoCAD.exe and accoreconsole.exe lofts a surface between two splines differently when run using a script and copy pasting commands in command line

3 REPLIES 3
Reply
Message 1 of 4
hardikyp
540 Views, 3 Replies

AutoCAD.exe and accoreconsole.exe lofts a surface between two splines differently when run using a script and copy pasting commands in command line

Hi,

 

I am trying to automate the creation of a solid boat geometry using scripting in autoCAD/accoreconsole. Mentioned below is the flow of my script:

 

  • Using a set of points in 3D space, generate 9 separate splines and set variable name as spline# using (setq spline# (entlast)) once each spline is generated
  • Loft surface between each adjacent spline
  • Select All splines and delete them
  • Union of the surfaces
  • rotate 3D
  • Save as dwg
  • Export as ACIS file
  • QUIT

 

Attaching the script file with this post.

 

The problem I am currently facing is that whenever I run the script, one of the lofted surface comes out weird. However, If I copy paste the contents of my script file in the command line of autoCAD, the 3D geomtery comes out as desired.

 

Please help me find where I am going wrong.

Labels (3)
3 REPLIES 3
Message 2 of 4
Michiel.Valcke
in reply to: hardikyp

I tried the script and the manual version, I can replicate the error but so far I also have not found a cause for the difference in behaviour. Maybe the people over at the customization forum will have a better understanding what is causing the problem

Why do you need to automate the creation of this shape? If it is just an excercise you can also try to do it in Autolisp instead of with a script. If you need to recreate this shape often for work I would suggest using a block or a template drawing.

Message 3 of 4
cadffm
in reply to: hardikyp

Okay, deep digging after 5 moth, but ok.

 

I didn't test it, but i couldn't see any osnap handling in your script and so i am guessing you stumbled about that.

 

Set your osnapcoord to 1 or handle the osnap otherwise.

Background: Copy&Paste to commandline is the same as type in by hand, 

but macro script or (send)command will detect as automation and the standard setting is:

Input coordinates by hand: Acad ignores running osnaps,

in automation acad respects running osnaps.

 

Again: I didn't check your case, but what i write matchs your description generally.

 

Sebastian

Message 4 of 4
Michiel.Valcke
in reply to: hardikyp

@cadffm @hardikyp 

I saw this post a while ago and I wanted to test it, but I kept putting it off and finally got to it. I'm sorry if this looks like I'm reviving a dead post.

What Sebastian mentioned is 100% correct and I completely missed it. I just added OSMODE 0 at the beginning of the script and everything worked perfectly. You can add OSMODE with the bitvalue of your preferred Osnaps at the end to put your object snaps back in working order.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report