autolisp conversion problem from autocad to microsurvey

Discussion of MicroSurvey CAD related issues and questions.

Moderators: Brian Sloman, Jason Poitras, James Johnston

autolisp conversion problem from autocad to microsurvey

Postby artb » Fri Oct 29, 2004 5:50 pm

I have a lisp routine to convert lines and/or arcs to polyines and give them all a common thickness that works in autocad but will not work in microsurvey.

I am including a portion of the code and see if anyone out there can help me.

(while (< v2 (sslength v1))
(setq pt1 (ssname v1 v2))
(if (= "POLYLINE" (cdr (assoc 0 (entget pt1))))
(command "pedit" pt1 "w" *th "")
(command "pedit" pt1 "" "w" *th "")
)
(setq v2 (+ v2 1))
)

I have triedmodifying the "pedit" autocad command to "polyedit" command (microsurvey alternative??) but it does not work.

The command appears to execute but it does not apply the value provided earlier in the routine to the polylines.

Any suggestions???

Artb
artb
artb
 
Posts: 53
Joined: Thu Oct 28, 2004 8:51 pm
Location: Vernon, B.C.

Lisp

Postby Jerry » Fri Oct 29, 2004 11:05 pm

Not sure why (command ..) called twice, anyway
(command "polyedit" (entlast) "w" 4.0 "")
Takes the last entity and changes the width to 4.0 units and cancels.

Sorry can't help more but I seldom hassle with sset.. stuff. Most of my stuff is point and click arrangements.

Good Luck.
Jerry
 

What is *th?

Postby Darcy Detlor » Thu Nov 11, 2004 10:59 am

The variable you are using here is a bit odd.

If I get the entity name of the entity and set it to "ename", then I can run this command at the command line:

(command ".polyedit" ename "w" 0.5 "")

and it sets the width of the polyline to 0.5 units.

What does the *th variable contain? Perhaps it is poor coding practice to use an operator in the variable name. It might not be valid.

Here is the complete code to demonstrate my test:

(setq ent (entsel))
(setq ename (car ent))
(setq width (getint "\nEnter a width:"))
(command ".polyedit" ename "w" width "")
(princ)
Darcy Detlor,
President,
MicroSurvey Software Inc.
[email protected]
User avatar
Darcy Detlor
Site Admin
 
Posts: 205
Joined: Tue Oct 29, 2002 10:14 am
Location: West Kelowna, BC


Return to MicroSurvey CAD

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron