Tharwat Posted August 16, 2010 Posted August 16, 2010 Hello. I wonder if it is possible in Lisp to change views of a drawing as best as view command . Regards, Quote
ReMark Posted August 16, 2010 Posted August 16, 2010 I'm sure it is possible but why reinvent the wheel? First take a look at Cadalyst magazine's CAD Tips section and see if anyone has already developed a lisp routine that does what you want. Start with the link below. Use the Search box that appears and type in the word "View". http://cadtips.cadalyst.com/ Quote
Tharwat Posted August 16, 2010 Author Posted August 16, 2010 Thanks Lt Dan's. That's an Autocad command, and I am looking for something related to UCS or trans function or ...... any useful idea as well. Regards, Tharwat Quote
Lt Dan's legs Posted August 16, 2010 Posted August 16, 2010 Sorry, thought you were looking for something on the command prompt vs a window Quote
The Buzzard Posted August 16, 2010 Posted August 16, 2010 Look in your Developer Help Section under DXF Reference and then Common Symbol Table Group. There is reference to UCS & VIEW. There is plenty to get you started with regard to the DXF coding. I always use the Developer Help Section as it is always available when I need it. Its a good place to start. Quote
David Bethel Posted August 16, 2010 Posted August 16, 2010 An view of the current UCS could look like this: [b][color=BLACK]([/color][/b]setq ucsv [b][color=FUCHSIA]([/color][/b]trans '[b][color=NAVY]([/color][/b]0 0 1[b][color=NAVY])[/color][/b] 1 0[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] [b][color=BLACK]([/color][/b]command [color=#2f4f4f]"_.VPOINT"[/color] ucsv[b][color=BLACK])[/color][/b] -David Quote
Tharwat Posted August 16, 2010 Author Posted August 16, 2010 Thanks Buzzard, and that's a very big base to start with. Thanks David, and your example is what I looking for to understand in all its ways, specially trans function. Because with this function we could control of our Lisp Routines' Directions, And if you would give more examples with it, it would be very helpful to me. Best Regards, Tharwat Quote
David Bethel Posted August 16, 2010 Posted August 16, 2010 It's pretty simple: VPOINT take WCS points only (trans '(0 0 1) 1 0) Translates the normal extrusion direction 0,0,1 from the current UCS to WCS. It cannot take Z axis rotations of a UCS into account. Probably can't deal with UCS origins that been moved either. -David Quote
CALCAD Posted August 16, 2010 Posted August 16, 2010 David, If I write a usable program with your example, it seems to require the ' T ' in the trans expression to work. Without the ' T ', I get strange results. I am using Intellicad, not Autocad, so there may be a difference, but I have not seen any differences before with trans usage. (defun c:vtest (/) (setq ucsv (trans '(0 0 1) 1 0 T)) (command "_.VPOINT" ucsv) (princ) ) Quote
David Bethel Posted August 16, 2010 Posted August 16, 2010 That's a bit weird. I'd have to do some reading up on the displacement flag. It's been a while since I used it. I thought it returned a extrusion vector but apparently not. -David Quote
Tharwat Posted August 17, 2010 Author Posted August 17, 2010 Hello, What is the difference between the following two examples; (trans '(0 0 0) 0 1) (trans '(0 0 0) 1 0) Because I can not see the difference in a drawing while using them. Regards, Quote
CALCAD Posted August 17, 2010 Posted August 17, 2010 tharwat313, I don't pretend to understand all about trans, but as I understand it : (trans '(0 0 0) 0 1) : this means transform the point (X0 Y0 Z0) from the WCS to the UCS. (trans '(0 0 0) 1 0) : this means transform the point (X0 Y0 Z0) from the UCS to the WCS. Nothing actually changes in the drawing. In this case, the transform function just calculates the location of a point measured in different coordinate systems. I hope this helps. Quote
Tharwat Posted August 18, 2010 Author Posted August 18, 2010 tharwat313,I don't pretend to understand all about trans, but as I understand it : (trans '(0 0 0) 0 1) : this means transform the point (X0 Y0 Z0) from the WCS to the UCS. (trans '(0 0 0) 1 0) : this means transform the point (X0 Y0 Z0) from the UCS to the WCS. Nothing actually changes in the drawing. In this case, the transform function just calculates the location of a point measured in different coordinate systems. I hope this helps. Thank you so much for your kind reply. You've been very helpful. Best Regards, Tharwat 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.