Jump to content

Recommended Posts

Posted

Hello.

 

I wonder if it is possible in Lisp to change views of a drawing as best as

view command .

 

Regards,

Posted

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/

Posted

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

Posted

Sorry, thought you were looking for something on the command prompt vs a window

Posted

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.

Document1.jpg

Document2.jpg

Posted

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

Posted

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

Posted

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

Posted

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)
)
Posted

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

Posted

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,

Posted

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.

Posted
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

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