Jump to content

(trans) explained


samifox

Recommended Posts

Hi. Can i say that autolisp dont respect ucs at all and commands respect ucs by all means,?

 

Certain AutoLISP functions perform calculations relative to the current UCS, for example, inters.

Link to comment
Share on other sites

  • Replies 29
  • Created
  • Last Reply

Top Posters In This Topic

  • samifox

    16

  • Lee Mac

    9

  • hanhphuc

    5

Top Posters In This Topic

Posted Images

From here:

 

To save space in the drawing database (and in the DXF file), the points associated with each entity are expressed in terms of the entity's own object coordinate system (OCS). With OCS, the only additional information needed to describe the entity's position in 3D space are the 3D vector describing the Z axis of the OCS and the elevation value.
Link to comment
Share on other sites

Hi

 

the doc say about UCS

User coordinate system—the working coordinate system. The user specifies a UCS to make drawing tasks easier. All points passed to AutoCAD commands, including those returned from AutoLISP routines and external functions, are points in the current UCS (unless the user precedes them with a * at the Command prompt). If you want your application to send coordinates in the WCS, OCS, or DCS to AutoCAD commands, you must first convert them to the UCS by calling the trans function.

 

this expression

 

(entmake (list (cons 0 "CIRCLE")            ;***
              (cons 6 "BYLAYER")
              (cons 8 "0")
              (cons 10 (list 0.0 0.0 0.0)1 0) ;***
              (cons 39 0.0)
              (cons 40 1.0)                ;***
              (cons 62 256)
              (cons 210 (list 0.0 0.0 1.0))))

 

will draw the circle on WCS origin ragedless of the active UCS

 

how come?

Link to comment
Share on other sites

as far as i know DXF are codes, now its being treated as a file? is it the DWG or part of it?

 

AutoCAD DXF

 

this expression

(entmake (list (cons 0 "CIRCLE")            ;***
              (cons 6 "BYLAYER")
              (cons 8 "0")
              (cons 10 (list 0.0 0.0 0.0)1 0) ;***
              (cons 39 0.0)
              (cons 40 1.0)                ;***
              (cons 62 256)
              (cons 210 (list 0.0 0.0 1.0))))

will draw the circle on WCS origin ragedless of the active UCS

 

how come?

 

The expression as it stands will error as a result of this line:

(cons 10 (list 0.0 0.0 0.0)1 0)

 

Assuming the trailing 1 & 0 are removed, the circle will always be constructed at the WCS origin since the OCS origin = WCS origin, regardless of the active UCS. You already know this from your thread here.

Link to comment
Share on other sites

AutoCAD DXF

 

 

 

The expression as it stands will error as a result of this line:

(cons 10 (list 0.0 0.0 0.0)1 0)

 

Assuming the trailing 1 & 0 are removed, the circle will always be constructed at the WCS origin since the OCS origin = WCS origin, regardless of the active UCS. You already know this from your thread here.

 

Hi

is the DXF is stands for a file format, DXF data structure is embedded into DWG, right?

 

User coordinate system—the working coordinate system. The user specifies a UCS to make drawing tasks easier. All points passed to AutoCAD commands, including those returned from AutoLISP routines and external functions, are points in the current UCS (unless the user precedes them with a * at the Command prompt). If you want your application to send coordinates in the WCS, OCS, or DCS to AutoCAD commands, you must first convert them to the UCS by calling the trans function.

 

why drawing database and DXF file are treated as two separate things?

 

as marked with bold, the guide claim all autolisp expressions returned points in UCS while in my case entmake ignores UCS

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