Author Topic: Routine not working, please help.  (Read 4269 times)

0 Members and 1 Guest are viewing this topic.

Bhull1985

  • Guest
Re: Routine not working, please help.
« Reply #15 on: October 01, 2013, 04:56:51 PM »
I am unsuccessful in having (itoa $value) be passed back to the (slide) function.
It keeps giving me a fixnump or stringp error depending on what I try
Can someone please tell me how to have the value of "year" be passed back to the slide function correctly?
Thank you.
Something to do with CABs reply, but I cannot get the VLIDE to display the watches correctly, it just freezes up my autocad and requires task manager else I would try to watch and determine which var to manipulate and how but I can't even tell.
Someone...anyone....*says a quick prayer that this thread will receive a response*

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Routine not working, please help.
« Reply #16 on: October 02, 2013, 09:41:05 AM »
See if this gets you any closer.

I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Routine not working, please help.
« Reply #17 on: October 02, 2013, 10:39:42 AM »
OK I like this version better.

I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Bhull1985

  • Guest
Re: Routine not working, please help.
« Reply #18 on: October 02, 2013, 10:42:23 AM »
Oh my goodness
You are absolutely the best!!!

This is incredible, instead of dealing with stringp/fixnump/consp errors I can now dissect what you've shown me to gain understanding.

Seriously, thank you very much CAB. If there's anything I can ever do for you just please let me know, you have no idea how much this means to me.
I was thinking that this routine would be the first failure but thanks to you- it's not.
Now time to stop being utterly giddy, and look at how you've made this work.
Oh I see that there's an update, and I'm dying to know if I was correct in applying the (cond) with the (and) statements as shown in this (likely incorrect) example.
It'll likely be time for me to clear all the junk I've got flying around in my head to take a fresh look at what you've done.

Bhull1985

  • Guest
Re: Routine not working, please help.
« Reply #19 on: October 02, 2013, 10:45:11 AM »
Does the 2nd version have the lists empty in your run?

The first one you posted was displaying the previews correctly (you're amazing- have I mentioned that?)

Then when I checked to see the 2nd version it's showing the slide in the preview window but all of the list_boxes are empty.
Probably something small, but i'm curious as to if the 2nd version has the lists populated on your machine when you run it.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Routine not working, please help.
« Reply #20 on: October 02, 2013, 11:42:25 AM »
OOps I'll update

I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Bhull1985

  • Guest
Re: Routine not working, please help.
« Reply #21 on: October 02, 2013, 11:51:30 AM »
Np CAB,
I'm still stunned that you were able to make that mess into something working.
And still very appreciative.
I'm finishing up the last slides now and will be sure to post in this thread with a (closer-to) complete routine, thanks so much for showing me that this was possible and how to do it properly.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Routine not working, please help.
« Reply #22 on: October 02, 2013, 12:14:27 PM »
See attached, revised.
Also changed the names in the DCL.

I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Bhull1985

  • Guest
Re: Routine not working, please help.
« Reply #23 on: October 02, 2013, 03:59:45 PM »
Great CAB, this works very well.
I have just finished making the rest of the slides so that it previews correctly. There's just over 100 of them so I won't be attaching them here... :P
I notice the changes to the action tile and will look into the vl-prin1-to-string function surely, seems to have made the difference there...
Another bit that I'll look up on is the
Code: [Select]
(mapcar (function car) arguments) because it's used extensively throughout the routine.
Breaking it down some each of those pieces of code are nested within the following statements, firstly:
Code: [Select]
(defun makelist (k l /)
(start_list k)
(mapcar (function add_list) l)
(end_list)
)
and then within the calls to that function
Code: [Select]
(makelist "part_catagory" (setq CaragoriesLst (mapcar (function car) data)))
(makelist "part_name" (setq NamesLst (mapcar (function car)(cadr (car Data)))))
(makelist "part_item" (setq ItemsLst (cadr (caadar data))))

All seem like pretty decipherable I'll just have to take them from the most nested statement outwards. Going to be a challenge to take it all apart, onto the console to see how it's all working but I look forward to the challenge.
Also the Visual Lisp Format Options at the bottom, that's something that I had never seen until yesterday actually, and haven't quite located what requires it but will continue to spend a lot of time with this baby, I really appreciate it and admire your skills at making it work. I don't think many people can do this sort of code, and I'm honored that you've given me the chance to learn.
I still have some ways to go....but this will occupy me for a great while.
Thanks indeed, and just give a pm if youd want view it with the slides.
Oh one more thing - there's this consp error that occurs if an item in the part_name is the first user selection after dcl opens.
I look forward to Vlide'ing that as well :)
« Last Edit: October 02, 2013, 04:32:00 PM by Bhull1985 »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Routine not working, please help.
« Reply #24 on: October 02, 2013, 04:33:22 PM »
On my way out but will reply tonight.

I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Bhull1985

  • Guest
Re: Routine not working, please help.
« Reply #25 on: October 02, 2013, 05:04:06 PM »
Have a good'n.
Okay, "function" is declaring the following to be a function, so what's actually happening is the (car) of data=caragoriesLst
Then namesLst is the (car) of (cadr (car data)), and so on and so forth for each iteration.
Sweet stuff, and now I'll really gain some understanding of how lists work in lisp once I setq data in the console and start (car) and nesting them as well.
Whoo, I feel like I've just been handed the rosetta stone. The actual one, not the software....onwards!

Eureka!
Code: [Select]
Command: (car data)
("Valves" (("Angle Valves" ("Angle Valve" "Angle Control Valve" "Flanged Angle
Valve" "Flanged Angle Control Valve")) ("Backpressure Regulators"
("Backpressure Regulator" "Flanged Backpressure Regulator" "Backpressure
Regulator w External Tap")) ("Ball Valves" ("Two-Way Motor Operated Ball Valve"
"Double Acting Piston Valve - Air Operated" "Piston Operated Ball Valve"
"Flanged Motor Operated Ball Valve" "Flanged Piston Operated Ball Valve"
"Flanged Ball Type Control Valve" "Flanged Double Acting Piston Valve - Air
Operated" "Flanged Ball Valve" "Flanged Ball Valve w Bleed Valve" "Flanged
Three-Way Ball Valve")) ("Bleed Valves" ("Ball Valve w Bleed Valve" "Gate Valve
w Bleed Valve" "Flanged Ball Valve w Bleed Valve" "Flanged Gate Valve w Bleed
Valve" "Flanged Gate Valve w Bleed Valve and Piston Actuator" "Gate Valve w
Bleed Valve and Piston Actuator")) ("Butterfly On-Off Valve" ("Butterfly On-Off
Valve" "Flanged Butterfly On-Off Valve" "Butterfly Valve" "Flanged Butterfly
Valve" "Butterfly Control Valve - HO" "Flanged Butterfly Control Valve - HO"
"Butterfly Control Valve" "Flanged Butterfly Control Valve")) ("Check Valves"
("Check Valve" "Flanged Check Valve")) ("Dia and Hand Act Control Valves"
("Control Valve w Hand Actuator" "Flanged Control Valve w Hand Actuator"
"Diaphragm Actuated Control Valve" "Flanged Diaphragm Actuated Control Valve"))
("Four Way Valves" ("Four Way Valve" "Flanged Four Way Valve")) ("Gate Valves"
("Gate Valve" "Flanged Gate Valve" "Right Flanged Gate Valve" "Left Flanged
Gate Valve" "Piston Operated Gate Valve" "Flanged Piston Operated Gate Valve"))
("Globe Valves" ("Globe Valve" "Flanged Globe Valve" "Globe Control Valve"
"Flanged Globe Control Valve")) ("Motor Operated Valves" ("Motor Operated
Valve" "Flanged Motor Operated Valve" "Two-Way Motor Operated Ball Valve"
"Flanged Motor Operated Ball Valve" "Right Flanged Motor Operated Valve" "Left
Flanged Motor Operated Valve")) ("Needle Valves" ("Needle Valve" "Small Needle
Valve" "Flanged Needle Valve")) ("Plug Valves" ("Plug Valve" "Flanged Plug
Valve")) ("Pressure Reducing Regulator" ("Pressure Reducing Regulator" "Flanged
Pressure Reducing Regulator" "Pressure Reducing Regulator w External Tap"))
("Solenoid Valves" ("Two-Way Solenoid Valve" "Three-Way Solenoid Valve"
"Four-Way Solenoid Valve" "Three-Way Solenoid Valve w Manual Reset" "Flanged
Three-Way Solenoid Valve" "Flanged Three-Way Solenoid Valve w Manual Reset"
"Flanged Two-Way Solenoid Valve")) ("Three Way Valves" ("Three Way Valve"
"Flanged Three Way Valve" "Three Way Control Valve - HO" "Piston Operated Three
Way Valve" "Pilot Valve w Manual Reset" "Flanged Pilot Valve w Manual Reset"
"Flanged Three Way Control Valve - HO" "Flanged Piston Operated Three-Way
Valve")) ("Misc Valves" ("Rotary Valve" "Diaphragm Valve"))))
and vastly different
Code: [Select]
Command: (mapcar (function car) data)
("Valves" "Instruments" "Stamps")
« Last Edit: October 02, 2013, 05:08:07 PM by Bhull1985 »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Routine not working, please help.
« Reply #26 on: October 03, 2013, 10:20:30 AM »
Yes you're getting it.  8)

The vl-prin1-to-string is just a method that allows you to view the code clearly in VLIDE & doesn't require you to quote the code.

Code: [Select]
(mapcar (function car) arguments)Just a way to preform the function CAR on every item in the list ARGUMENTS.
And it returns the results in a list.
Code: [Select]
(mapcar (function car) '((1 1 1)(2 2 2)(3 3 3)))  
returns  (1 2 3)

Visual Lisp Format Options at the bottom:
That is a setting in VLIDE to put the format code in the lisp so any future user in VLIDE will automatically use the formatting for that lisp.

You're welcome for the help. My time is limited due to current work load so there may be times I neglect you. :)

Attached is a fix for the error you were getting.
« Last Edit: October 03, 2013, 10:23:32 AM by CAB »
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Bhull1985

  • Guest
Re: Routine not working, please help.
« Reply #27 on: October 03, 2013, 02:25:59 PM »
Just got back to the office from a 4 hour class to get a certification.
Well that's done and I'll get a few hours with this and a few other tools that I've been thinking of!
We've got several programs that we run along with autocad and I am starting to think about what autolisp may be able to do in so far as opening these programs...just little shortcuts, I'm thinking, but it sounds fun to do next week or whatnot....
Because we know what i'll be doing for the next good while , still!
Anyhow thanks CAB, don't worry about 'neglect' because what you've shown me is so far from neglect I could kiss you.
Aha...    :-P

also that's interesting it looks as if you turned the data that makelist "part_name" uses into a variable containing a list, to fix the consp error. Makes sense if that's correct- also the differing syntax at the very bottom i'll need to look closer at. Thankyou!!
« Last Edit: October 03, 2013, 02:31:19 PM by Bhull1985 »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Routine not working, please help.
« Reply #28 on: October 03, 2013, 03:45:00 PM »
The variable Names needed to be initialized during the start up of the DCl.
Before I had it as one of the Actions to refresh it's data and still is.
What happened was when you clicked on tile  "part_name" it needed the Names list to be valid.
Before it was nil at start up.

Glad you can make use of the routine now.

 
Quote
I am starting to think about what autolisp may be able to do in so far as opening these programs...just little shortcuts
That's how to learn, start with little helper routines and expand as you knowledge grows.

Enjoy.


I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.