Author Topic: Can someone steer a noob in the right direction?  (Read 13007 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Can someone steer a noob in the right direction?
« Reply #45 on: January 13, 2012, 07:58:28 AM »
Thanks Marko, I typically do not add the DCL creator routine until program development has ended and you are near final debugging.

Thanks for the bug report, I too have seen reports of that bug but was not able to recreate it.
Version 1-3 should not have that bug, correct?

No time this morning but will be back after lunch to dig into the problem.
Maybe the command is not canceled / ended properly and needs
(command)(command) at the end of the line type get routine.

See you all later today.
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: Can someone steer a noob in the right direction?
« Reply #46 on: January 13, 2012, 08:06:06 AM »
After more review I see you removed my DCL file error checking.
Code: [Select]
  (setq dclfile "LayerMaker.dcl"
        dclname "LayerMakerDialog"
  )
  (cond
    (nil ; debug (not (create_dcl dclName))            <-------<<<  normally a call to create the DCL
     (prompt (strcat "\nCannot create " dclfile "."))
    )
    ((< (setq dcl# (load_dialog dclfile)) 0) ; Error       <--------<<<  make sure the DCL can be loaded
     (prompt (strcat "\nCannot load " dclfile "."))
    )
    ((not (new_dialog dclname dcl#)) ; Error             <--------<<<  make sure the DCL name is correct
     (prompt (strcat "\nProblem with " dclfile "."))
    )
    (t ; No DCL problems: fire it up

True that your method does not need all these additional checks but I tend to error on the side on caution.  8-)
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.

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Can someone steer a noob in the right direction?
« Reply #47 on: January 13, 2012, 08:17:09 AM »
CAB, if you plan to modify version of LayerMaker 1-4 - wihout dcl.lsp I forgot to add variable "fn" to localize it into (defun c:layermaker ( / ... ) ), so please add this... Yes, I've removed dcl checking in (cond (...)...), that was the only way (my opinion) I could implement temp dcl...

M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Can someone steer a noob in the right direction?
« Reply #48 on: January 13, 2012, 08:36:01 AM »
Thanks for your help.

This code call the sub function to create the DCL
Code: [Select]
((not (create_dcl dclName))            <-------<<<  normally a call to create the DCL
     (prompt (strcat "\nCannot create " dclfile "."))
    )

so just create
Code: [Select]
(defun create_dcl (fname / acadfn dcl-rev-check)
---your code here----



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: Can someone steer a noob in the right direction?
« Reply #49 on: January 13, 2012, 12:58:54 PM »
I'm back.
Went back to the DCl line type selection although no way yet to import a new line type.
See attached version 1.5
This version will create the DCL file as needed.
Also added check box to allow user to return to the dialog after creating a layer for those time when more than one layer is being added.


<old code removed>
« Last Edit: January 13, 2012, 06:21:51 PM 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.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Can someone steer a noob in the right direction?
« Reply #50 on: January 13, 2012, 01:10:12 PM »
I'm back.
Went back to the DCl line type selection although no way yet to import a new line type.
<snip>

Command: (dump (vla-get-linetypes (vla-get-activedocument (vlax-get-acad-object))))
; IAcadLineTypes: The collection of all linetypes in the drawing
; Property values:
;   Application (RO) = #<VLA-OBJECT IAcadApplication 0000000140547198>
;   Count (RO) = 3
;   Document (RO) = #<VLA-OBJECT IAcadDocument 0000000028536f60>
;   Handle (RO) = "5"
;   HasExtensionDictionary (RO) = 0
;   ObjectID (RO) = 50
;   ObjectID32 (RO) = 50
;   ObjectName (RO) = "AcDbLinetypeTable"
;   OwnerID (RO) = 0
;   OwnerID32 (RO) = 0
; Methods supported:
;   Add (1)
;   Delete ()
;   GetExtensionDictionary ()
;   GetXData (3)
;   Item (1)
;   Load (2)
;   SetXData (2)
T

The two arguments are, in order, LinetypeName LinetypeFile.

Will this work for you Alan?
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Can someone steer a noob in the right direction?
« Reply #51 on: January 13, 2012, 01:30:53 PM »
So you've returned to v1.3 linetype dialog... I've checked v1.5 and noticed that you haven't noticed that I changed line in (cond ...) to make last created layer current... So, please revise v1.5 with this line :
Code: [Select]
(msg (progn (princ (strcat "\nLayer [" layerpreview "] created.")) (setvar 'clayer layerpreview)))

M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Can someone steer a noob in the right direction?
« Reply #52 on: January 13, 2012, 01:37:05 PM »
Thanks Tim but no.
What I have now is a DCL that allows selection of the loaded line types to apply to the new layer.
The OP wanted to be able to select from a file to load that line type into the DWG.
I do have  loader routine (by name & file name)  but we now get into User selection of the file to explore and then display a list of line types to choose from.
The gotya is that the preview of line types are difficult to display in a DCL.
This aspect may be as or more difficult that the original routine.  :-o

The ACAD linetype dialog was nice but caused ACAD to hang. I did not find fix for that but may look at it again.
Another option Lee proposed was to use DODlib's dialog which is nice but not available for ACAD2006 which is as high as I go and requires DosLib to be loaded.

There you have it.  :-)
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: Can someone steer a noob in the right direction?
« Reply #53 on: January 13, 2012, 01:38:38 PM »
So you've returned to v1.3 linetype dialog... I've checked v1.5 and noticed that you haven't noticed that I changed line in (cond ...) to make last created layer current... So, please revise v1.5 with this line :
Code: [Select]
(msg (progn (princ (strcat "\nLayer [" layerpreview "] created.")) (setvar 'clayer layerpreview)))

M.R.

Oh, I missed that.
Thanks I'll change it.
OK new file loaded above. (version 1-5)
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.

NoTebowNoHope

  • Guest
Re: Can someone steer a noob in the right direction?
« Reply #54 on: January 13, 2012, 04:50:21 PM »
I'm back.
Went back to the DCl line type selection although no way yet to import a new line type.
See attached version 1.5
This version will create the DCL file as needed.
Also added check box to allow user to return to the dialog after creating a layer for those time when more than one layer is being added.
Now that is pretty slick!  That is pretty much what I was after CAB. Thanks for your effort in putting this together.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Can someone steer a noob in the right direction?
« Reply #55 on: January 13, 2012, 06:20:55 PM »
Glad you like it.
Made some mods to version 1.5 see attached.
Changes the linetype selection dialog but no import feature.
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.

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Can someone steer a noob in the right direction?
« Reply #56 on: January 14, 2012, 02:03:26 AM »
Here is my version... LayerMaker 1-5.lsp - added : (vl-file-delete dclfile) - erase temporary dcl; loaded all linetypes from acadiso.lin into memory before dialog start - they are now always loaded; added titles for additional function (GetLinetype) and main function inside *.lsp; reversed order in process of loading them, so after appload return value of loading is C:LayerMaker (function name for starting routine)...

M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Can someone steer a noob in the right direction?
« Reply #57 on: January 14, 2012, 07:59:20 AM »
Marko
I appreciate you effort to clean up the routine but I do that when all debugging is done.
I like to run the file through several test sessions before I tidy up.
As for the deleting of the DCL file, I don't see the need. My routine checks the date in the header
so that if the main routine has altered the DCL the old DCL is over written with the new on.
The header is created with my DCL2Lisp routine http://www.theswamp.org/index.php?topic=1291.0
Therefore no need to create it every time the routine is run. Just the way I designed it.

Loading every linetype is not desirable IMO, because you will use ether metric or English line types
but not both so the others clutter up the displays. Just my opinion but the OP may want that.

I have no time this morning but maybe later today to do some more work on the routine.

Thanks again for your help.  :-)
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.

ribarm

  • Gator
  • Posts: 3279
  • Marko Ribar, architect
Re: Can someone steer a noob in the right direction?
« Reply #58 on: January 15, 2012, 11:22:42 AM »
CAB, you haven't posted some news, so all I could do is modify your version of v1.5... Everything is the same as my version, only it has now your dialog for linetypes and I think it's better now... So I named it v1.6 - changed title of main dialog (v1.6)... Still I couldn't fix the problem with v1.4 :
(initdia)
(command "_.LINETYPE")
and I've tried everything I could think of. By my current knowledge, I think I can't fix that bug. (only have tests on A2008 - but doesn't matter, it won't work and it won't and it won't...)

So, I am posting now v1.6. If you think I was wrong, you can remove line : (vl-file-delete dclname) - I use routine with deleting *.dcl after lsp ends (It isn't slower if needed to create new dcl, by my opinion, and I really don't want to create files on HD that are unnecessary - lisp will create it weather it exist or not. I only wanted to be removed after execution)... Anyway *.lsp is bigger, so why make the same data twice - dcl from lsp?

I've removed "load" option in your dialog - it loads all linetypes automatically from acadiso.lin (also if needed and user has it - user may change it to some other *.lin to be loaded automatically)... I don't know what you meant by "load" - "under construction :)" - you haven't posted v1.6, so now it may be perhaps v1.7...

Thanks for thanking me, I only did what I could and had free time...
Regards, sincerely, M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Can someone steer a noob in the right direction?
« Reply #59 on: January 15, 2012, 05:25:41 PM »
Marko,
I've been rather busy this weekend and no work on the routine

I've had no luck either with the (command "_.LINETYPE")

Quote
I don't know what you meant by "load" - "under construction
My thought was to open a file dialog for the user the select a lin file and then
open the line type selection dialog to import the chosen line types.
Similar to what ACAD does with the (command "_.LINETYPE")

I've done no work on the LOAD and may not.

I guess we differ in thought about the 4612 byte dcl file existing on the 2 terabyte hard drive.
In my version the DCL is written once & only again IF the header has changed or if not found.

Personally I do not want all line type's from ACAD,lin loaded in my drawings. JMO
Nor would I want all line types loaded from another file I selected.

I'll try to spend some time right now on the routine.

Talk to you later.  :-)

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