Jump to content

eimimitu

Recommended Posts

I've searched high and low but came up empty...

 

Simple routine does the following:

 

 (vl-cmdf "ucs" "w");switches to WCS-good
 (vl-cmdf "copy" ent "" "_non" bse "_non" "*0,0");copies ent from bse point to WCS origin-[color="red"]not good[/color]
 (vl-cmdf "dxfout" "" "v" "lt2000" "o" "l" "" "");export copied to DXF-good
 (entdel (entlast));deletes copied-good
 (vl-cmdf "ucs" "p");returns to previous UCS-good

 

Issue: It copies the objects to origin of the UCS that was set when routine started... Above only works if the drawing is already in WCS when I call the routine.. It also works when i put the ["ucs" "w"] command before my ssget for "ent" and getpoint for "bse" functions. But it's not as smooth visually so not ideal for my goals...

 

How do I force "ent" from "bse" to WCS origin?

 

I think the answer is trans function but I couldn't figure out how to implement it.. Sounds so simple but what the F... Any and all help is appreciated!

Link to comment
Share on other sites

Roy:

no dice unfortunately... does the exact same thing :/

 

when i do it in AutoCAD one command at a time it works fine also... but in lisp it's like it copies the object to origin faster than the UCS updates to WCS even-though it's placed before the copy command

Link to comment
Share on other sites

Change:

(vl-cmdf "copy" ent "" "_non" bse "_non" "*0,0")

To:

(vl-cmdf "_.copy" ent "" "_non" (trans bse 1 0) "_non" '(0 0 0))

 

Or follow Roy's suggestion and remove:

(vl-cmdf "ucs" "w")

Link to comment
Share on other sites

yes and yes...

 

And now that you break it down like that, all I've been reading suddenly makes sense:

 

Roy is simply translating the origin of wcs (0) to ucs (1) because my "bse" point was specified in ucs

Mr. Mac is translating "bse" from ucs (1) to wcs (0) and placing it at origin (0 0 0)...

Eureka!

 

Thank you both!

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