OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: vladgothe on March 28, 2014, 03:12:12 AM

Title: Xdata from grid
Post by: vladgothe on March 28, 2014, 03:12:12 AM
In my project, I had a grid in a modal form. I used a button to fetch data from current selected row in grid and assign it as xdata in a polyline. Soon, I realised I need a modeless form, so I remade all the controls for the new form. The problem is that the function which assigned xdata is not working anymore and I don't know why.
Can somebody help me?
I used OpenDCL Studio 8.0.0.4.
This is the project:
Title: Re: Xdata from grid
Post by: Fred Tomke on March 28, 2014, 04:07:47 AM
Hi, I have just not the chance to test but make sure that the control that invokes modifying entities has set event invoke to asynchronously.
Fred
Title: Re: Xdata from grid
Post by: vladgothe on March 28, 2014, 04:44:34 AM
I did what you said, but still doesn't work. Maybe it's a bug. When the form was modal, it worked perfectly, but after I changed it with the modeless form, it doesn't work anymore.
Title: Re: Xdata from grid
Post by: owenwengerd on March 28, 2014, 05:25:18 AM
Stating that something "doesn't work" is not very useful for someone to help you solve the problem. What are the exact steps you take, what do you expect to happen, and what actually happens? If there is an error, what is the error message? What have you done to pinpoint the source of the problem? Have you verified that your event handler is called as expected? Have you stepped through the event handler in the debugger to see where it fails?
Title: Re: Xdata from grid
Post by: roy_043 on March 28, 2014, 06:37:07 AM
The problem is not related to ODCL at all.
The problem:
Code (autolisp) Select
(setq e (entget obj))
(setq e1 (list (list -3 (list "SIGMA"
  (cons 1000 an) (cons 1000 jud) (cons 1000 bcpi) (cons 1000 nrcerere)   
))))
(append (entget obj) e1)
(entmod (entget obj))

Should be:
Code (autolisp) Select
(setq e (entget obj))
(setq e1 (list (list -3 (list "SIGMA"
  (cons 1000 an) (cons 1000 jud) (cons 1000 bcpi) (cons 1000 nrcerere)   
))))
(entmod (append e e1))


I advise you to improve your coding style:
- Localize variables.
- Indent your code.
- Use more meaningful names for dialog controls.
Title: Re: Xdata from grid
Post by: vladgothe on March 28, 2014, 06:53:12 AM
Thanks, Roy, that was my bad. I posted an older code. The application will not be in english language and I tried to translate it to be readable by others. I modified the code as you wrote, but entmod is not working. Maybe it's my computer's fault.

UPDATE: I forgot to set event invokes to asynchronous. Now it's working properly.
I'm not a programmer, I work as a surveyor, but sometimes I write for myself such applications to ease my work. Thank you for advices!