Jump to content

Location query error


M76

Recommended Posts

Hi

 

I'm trying to run a location query from a lisp but it gives an error message:

 

"Invalid data type, or data overflow: ENNAME"

 

I'm quoting the relevant parts of the developer help, for those who doesn't have map3d:

 

(ade_qrydefine joinop bggroups not_op condtype qrycond endgroups)

 

Returns a condition ID or nil.

 

joinop A joining operator: "and" or "or" or "" (none). If "" (none) is specified, the default joining operator is used (see ade_prefgetval).

bggroups For grouping this condition with others in the query definition you are building. Use one or more open parentheses as needed, or "" (none). For example, "((".

not_op The NOT operator, if needed: "not" or "" (none).

condtype A condition type: "Location", "Property", "Data", or "SQL".

qrycond A condition expression. Depends on the condition type. See Condition Expressions below.

endgroups For grouping this condition with others in the query definition you are building. Use one or more close parentheses as needed, or "" (none). For example, "))".

 

 

Location-Polyline-Fence

 

("polyline" "fence" ename)

 

ename AutoCAD entity name, or a set of points, or "?". If "?", when the query executes, it prompts the user to click a set of points.

 

 

And here is my code, I also tried it with points list, but the error message is the same.

 

(setq lof (ssget "_X" (list (cons 0 "LWPOLYLINE") (cons 8 "_lay"))))
(if lof 
	(progn
		(setq hlof (sslength lof))
		(setq i 0)
		(while (< i hlof)
			(setq enname (ssname lof i))
			;(make-vert-list enname)
			(ade_qryclear)
			(ade_qrysettype "draw")
			(ade_qrydefine '("" "" "" "Location" ("polyline" "fence" enname) ""))
			(tpm_qrysettoponame "foldreszlet")
			(tpm_qrysetrestopo (strcat "valogat_" (itoa i)) )
			(ade_qryexecute)
			(setq i (1+ i))
		)
	)
)

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