Jump to content

Problems importing XYZ from script.


Petoner

Recommended Posts

Hi all, I'm new in the forum, but it looks like there are some experts around that can share some knowledge.

 

My problem is the following:

 

I have created a macro in excel that selects a series of points and assigns them some coordinates Easting Northing and RL (X,Y,Z). Then a second macro reorganises all the data and groups it as I need. At the end it creates a script.

 

I'm trying to create some spheres and some 3Dpolylines from the center of the spheres.

 

I think I know how to do that. Since I have X,Y,Z for each point I just got the script to write the following:

 

 

_Sphere

646063,531851,111 30

 

 

text 646093,531881,111 25 0 BH21>>

 

For the polylines I do the same thing with 3Dpoly command.

 

I set my layer, I get the command Sphere, XYZ and diameter. then I add some text. From what I have seen that's the right way to do it.

 

The problem comes when I run the script. It creates the layers fine, it runs the command Sphere but then it crashes because it cannot understand that the numbers separated by "," are actually X,Y,Z. It keeps on asking me to specify the center point for my sphere.

 

I have the feeling that it may have something to do with my AutoCad settings but I'm not exactly sure what. I have searched the web and multiple forums for days with no success. I finally decided to come here and ask people with more experience than me, see if I can get someone to point me in the right direction.

 

Thanks to all in advance!

Link to comment
Share on other sites

And you have tested these same numbers in your drawing by entering them at the command line and they work right?

Link to comment
Share on other sites

Hi Guys,

 

Yes, if I use the sphere command in the command line and then copy paste the coordinates from Excel in the command bar it works perfectly. It is only when it comes from the script that it doesn't work.

 

Below I pasted parts of the script, not the whole thing because it is basically a repetition of those lines some few hundred times.

 

 

 

osnap

off

layer new Bore color 7 Bore

 

layer color 7 Bore

 

layer new Soil color 20 Soil

 

layer color 20 Soil

 

(...)

layer set Bore

 

_Sphere

646063,531851,111 30

 

 

text 646093,531881,111 25 0 BH21

 

_Sphere

646147,531752,105 30

 

 

text 646177,531782,105 25 0 BH12

 

_Sphere

646205,531732,118 30

 

 

text 646235,531762,118 25 0 BH33

 

(...)

 

layer set Soil

 

_3dpoly

645963, 532052, 114

645963, 532052, 113.8

 

 

layer set Soil

 

_3dpoly

645963, 532052, 113.8

645963, 532052, 111

 

 

(...)

>>

 

Thanks for your help!

Link to comment
Share on other sites

_Sphere

646063,531851,111 30

this space equal a enter key

this space equal a enter key

text 646093,531881,111 25 0 BH21

 

try

646063,531851,111

30

text

_Sphere 646063,531851,111 30

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