Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Image selection inside of a Lisp file is not working

2 REPLIES 2
Reply
Message 1 of 3
karl.gouldingUGC2M
224 Views, 2 Replies

Image selection inside of a Lisp file is not working

I have the following code which had worked on C3D 2020 fine but now that we have upgraded to C3D 2022 it seems not to work at all, if I break it up and run it individually piece by piece it works, but as a lisp routine it just doesnt.
(vl-load-com is loaded elsewhere)

Any ideas would be of help

 

(defun C:ifade (/ mycurtab imgss n featobj imgssobj)
	(if (not (= (setq mycurtab (getvar "ctab")) "Model"))
		(setvar "Tilemode" 1)
	)
	(command "regen")
	(setq imgss (ssget "x" (list '(0 . "*image"))))
	(if imgss
			(repeat (setq n (sslength imgss)); then
			(princ (strcat "Images processing: " (itoa n) \n))
			(setq featobj (vlax-ename->vla-object (ssname imgss (setq n (1- n)))))
			(setq imgssobj (vlax-vla-object->ename featobj))
			(command "._imageadjust" imgssobj "" "F" "50")
			(princ (strcat "\n" imgssobj " set fade to 50%\n"))
		); repeat [then]
		(princ "\nSelection set for image not found\n")
	)
	(command "regen")
	(if (not (= mycurtab "Model"))
		(setvar "ctab" mycurtab)
	)
)

 

 

 

PSI have resorted to running this as a copy past into the command prompt.

 

(setq imgss (ssget "x" '((0 . "*IMAGE"))))
(repeat (setq n (sslength imgss)); then
(princ (strcat "\nImages processing: " (itoa n) "\n"))
(setq featobj (vlax-ename->vla-object (ssname imgss (setq n (1- n)))))
(setq imgssobj (vlax-vla-object->ename featobj))
(command "._imageadjust" imgssobj "" "F" "50")
)

 

2 REPLIES 2
Message 2 of 3

Is there a reason that you have this line commented out?

 

;(setq imgss (ssget "x" (list '(0 . "*image"))))
Message 3 of 3

Yep I was testing different variations of the same thing and when I posted this I removed the other 2 but not the comment. Fixed it now

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report