eimimitu Posted January 18, 2018 Share Posted January 18, 2018 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! Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted January 18, 2018 Share Posted January 18, 2018 Instead of: "*0,0" Use (trans '(0 0 0) 0 1) Quote Link to comment Share on other sites More sharing options...
eimimitu Posted January 18, 2018 Author Share Posted January 18, 2018 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 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 18, 2018 Share Posted January 18, 2018 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") Quote Link to comment Share on other sites More sharing options...
eimimitu Posted January 18, 2018 Author Share Posted January 18, 2018 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! Quote Link to comment Share on other sites More sharing options...
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.