Jump to content

Any way to speed up this code?


Guest kruuger

Recommended Posts

  • Replies 37
  • Created
  • Last Reply

Top Posters In This Topic

  • alanjt

    12

  • Lee Mac

    6

  • Se7en

    2

  • MSasu

    1

Top Posters In This Topic

Guest kruuger

it is very weird.

when i do this (FREEZEINVIEWPORT "DRAWER3" 1) nothing happen but after this (command "_laythw") all layer been thawed except DRAWER3 which became freezed.

 

kruuger

Link to comment
Share on other sites

Guest kruuger
My code will change the settings in the Layer Manager.

very clever but without changes on screen it might be very confusing.

 

kruuger

Link to comment
Share on other sites

i saw this program. it is unbelievable what can be done with lisp.

 

for my purpose i apply Alan filter code and programs works fine.

 

kruuger

Why'd you change the syntax in the code I posted. Now it doesn't localize all the variables.

 

I understand what you've done to modify it, but the functionality works as such:

(setq FRZLIST (LayerFilter "*dim*" D_LYER))

Using what I posted and not your modified version.

Link to comment
Share on other sites

Guest kruuger
Why'd you change the syntax in the code I posted. Now it doesn't localize all the variables.

 

I understand what you've done to modify it, but the functionality works as such:

(setq FRZLIST (LayerFilter "*dim*" D_LYER))

Using what I posted and not your modified version.

i made small modification to code. try to follow your info.

now when i leave "s" in your function as local then i got error:

Error: bad argument type: stringp nil

if i'm correct everything should be ok with "s" as a local.

do you know what can be wrong?

 

thanks

kruuger

Scale VP.lsp

Link to comment
Share on other sites

I wrote it to return a comma delimited string of layers, that way you could feed all the layers to VPLayer once and increase processing time.

 

This is all you need:

(if (setq Layers (AJT:LayerFilter "*dim*,*text_*" (strcat D_LYER "," T_LYER)))
 (command "_vplayer" "_f" Layers "_c" "")
)

I haven't tested Gile's routine (Lee's posted link), but I'm sure it's even faster.

Link to comment
Share on other sites

Guest kruuger
I wrote it to return a comma delimited string of layers, that way you could feed all the layers to VPLayer once and increase processing time.

 

This is all you need:

(if (setq Layers (AJT:LayerFilter "*dim*,*text_*" (strcat D_LYER "," T_LYER)))
 (command "_vplayer" "_f" Layers "_c" "")
)

I haven't tested Gile's routine (Lee's posted link), but I'm sure it's even faster.

Alan i hope you are patient. i'm still rookie with all this stuff.

believe me your speed code is almost same fast as GEF; (many layers, few xref). works very well.

when we work viewport by viewport it is faster type s4, s16 rather then go thru GEF. But working with multiple vport/layout there is no questions GEF is amazing tools.

 

again i'm posting my file. i hope that now all is ok.

 

thanks

kruuger

Scale VP.lsp

Link to comment
Share on other sites

Alan i hope you are patient. i'm still rookie with all this stuff.

believe me your speed code is almost same fast as GEF; (many layers, few xref). works very well.

when we work viewport by viewport it is faster type s4, s16 rather then go thru GEF. But working with multiple vport/layout there is no questions GEF is amazing tools.

 

again i'm posting my file. i hope that now all is ok.

 

thanks

kruuger

I'm very patient, as long as the other has a good attitude and listens. :)

 

Now, you are still trying to act as if my LayerFilter sub is creating a list. It only creates a comma delimited string of layer names. This way it can be fed to VPLayer one time, thus avoiding executing VPLayer more than once.

In my last post, I gave you the necessary coding. However, if you are hell-bent on using another subroutine, replace yours with the following:

 

(defun SCVP_FREEZE (LayString)
 (if (eq (type LayString) 'STR)
   (command "_.vplayer" "_f" LayString "_c" "")
 )
)

This will only execute VPLayer once and will be a whole lot faster.

 

I still say you should explore Gile's routine, in the link Lee posted.

Link to comment
Share on other sites

Guest kruuger

 

(defun SCVP_FREEZE (LayString)
 (if (eq (type LayString) 'STR)
   (command "_.vplayer" "_f" LayString "_c" "")
 )
)

This will only execute VPLayer once and will be a whole lot faster.

 

I still say you should explore Gile's routine, in the link Lee posted.

 

oo, shi.. i forgot about this foreach/wcmatch.

i think that this is fine for me:

(defun SCVP_FREEZE (Lay)
 (command "_vplayer" "_f" Lay "_c" "")
);defun

i run vlplayer twice because of different Scl. For some scale i also need to freeze *a-hat* or *veener*. even with this two loops it takes 0.5sec to freeze (very "heavy" dwg with few xref's). more time i'm waiting to create vport.

 

GEF is not for me. usually i create few vports in layout in different scale (different layer to freeze). it is faster to me type the shortcut rather then setting all in GEF.

 

thanks

kruuger

Link to comment
Share on other sites

Ill advised, since you aren't checking if there's a valid string (or anything) being sent do the routine. If LayerFilter is nil, your VPLayer sub will crash. Use what I provided.

 

BTW, what's GEF?

 

oo, shi.. i forgot about this foreach/wcmatch.

i think that this is fine for me:

(defun SCVP_FREEZE (Lay)
 (command "_vplayer" "_f" Lay "_c" "")
);defun

i run vlplayer twice because of different Scl. For some scale i also need to freeze *a-hat* or *veener*. even with this two loops it takes 0.5sec to freeze (very "heavy" dwg with few xref's). more time i'm waiting to create vport.

 

GEF is not for me. usually i create few vports in layout in different scale (different layer to freeze). it is faster to me type the shortcut rather then setting all in GEF.

 

thanks

kruuger

Link to comment
Share on other sites

GEF it is Gile's routine.

I use it few times and it stick to my head :)

 

Thanks once again Alan

kruuger

Ahh, OK.:lol:

Enjoy.

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