PDA

View Full Version : Solved: Polarpoint



rvetrano
07-15-2004, 05:46 PM
Hi

I appolagize for sending my thank you response to the wrong place. I have another Autocad question.

I have a line running from 0,0,0 to 120,5,5. I want to put a point 4" up the line.

I use polarpoint to move out the 4" along the line and then I use the rise that the 'Z' triangle makes to move it up. However it just doesn't come out right.

Does anyone know of another command or any suggestions?

Thanks Bob vetrano

lucas
07-15-2004, 07:32 PM
Bob,

I'm not sure I quite understand what you are trying to do. Are you trying to add a 4" line to the end of the line you have created in the direction of Z or are you trying to find a point along the line you have created that is 4" from one end and if so, which end. And if its the second case, are you trying to put a line at that point? Also if its the second point, your line is running from 0 to a few degrees above the X axis so is the 4" being measured along the X axis or along the line you have drawn?

Might help to upload your file or an example of what you are trying to do in a new drawing if your file is proprietary. You can attach it to your post by scrolling down when you are writing your post and look for "Manage Attachments" Just click on it and browse to your file on your hard drive and when you have it highlighted, click ok and it will be attached to your post. Its really pretty hard to communicate everything you need to know about a problem like this with a note. I do better if I can see the problem. To post here, just click on "post Reply" below the last post on the left side.

Another question I would ask you is what view you are using? Even working on 3D it helps to be in 2D wireframe. Also whether you are using your 3D orbit to turn it and look at the results.

Another thing worth mentioning is that I am not exactly sure what you mean when you say "polarpoint" and "use the rise that the 'Z' triangle makes" These are not terms that I am familiar with, sorry.

Man, thats a lot of questions isn't it Bob. Sorry to be so longwinded.

Steve

rvetrano
07-16-2004, 11:50 AM
steve

What I am trying to do is put a circle 4" up a 3D line. see attached file 'drawline'

thanks

Bob vetrano

Tommy
07-16-2004, 12:39 PM
Hi Bob,

What I see first is that the "angle" you are using is in radians not degrees.

These 2 functions are real handy to have DtoR takes degrees and gives radians, and of course RtoD takes radians and gives degrees. Once this was implemented the error on the ucs went away. Another thing is when you are determining the angle there is a requirement to check for 0. Let me know if you need more help.

Public Function DtoR(ThisAngle As Double) As Double
DtoR = (ThisAngle / 180) * 3.14159265359 ' this is pi
End Function
Public Function RtoD(ThisAngle As Double) As Double
RtoD = (ThisAngle * 180) / 3.14159265359
End Function

Happy Coding :type

lucas
07-18-2004, 10:39 AM
Tommy,
I was wondering if you could suggest any websites or books that you would recommend to someone trying to learn more about VBA in AutoCAD.

You seem to have a good deal of experience yourself.

I have been using CAD for a while now and have learned how to use the LISP routines but have only recently discovered the possibilties of using VBA in CAD. I was able to load the .dvb file in cad and look at the code but there is much there that I don't understand. Currently using ver.2004

Also if you could explain the difference between Lisp and VisualLisp. Is VisualLISP just another way of saying VBA?

Steve

rvetrano
07-18-2004, 04:21 PM
Steve
I thought I was converting the angle to radians. Thanks for your help. I couldn't get the ucs to change nomatter what I did.
I solved the problem of moving up the line by getting cross reference points. Distance to the circle is certain % of line then I applied that % to the X,Y & Z.

Tommy
I found a book "Mastering Autocad VBA" by Marion Cottingham to be very useful.

Thanks
bob v

Tommy
07-19-2004, 07:10 AM
Steve,
I have been using Acad since ver 2.5, I used that version for a month then jumped to ver 9. Curently I am using ver 2000i. I learned by trial and error and reading the books that come with Autocad, and looking at the examples. Then, as Bob has pointed out, I found the book Mastering Autocad, very good book. I did not realize that they had written a book on VBA, should have known :). Cadence Magazine is good also for tricks and tips.

Vlisp is lisp with a debugger, I prefer to use vlisp over lisp because it is easier to debug.

Now that you have discovered VBA you find it a lot easier to code. The only thing I can say is read the help files and use the object browser. The examples that come with Autocad will help out also.

Later

lucas
07-19-2004, 07:41 AM
Thanks,
Both of you. I have been to Cadence but it was before I discovered VBA, guess I need to go back and look around. I'll be buying the book also.
regards,
Steve

Edit:
I found the book at amazon for $5.75 used. thanks for you help