Page 2 of 2

Posted: Mon Aug 20, 2001 9:56 am
by tooldesigner
That is what I thought with the color of the layer. But I will have to double check mine again because it doesn't change the color of the layer. It leave it white. So it is something in my code that is not right.

Posted: Mon Aug 20, 2001 3:55 pm
by John Finlay
tooldesigner,

Yes, there is something wrong with your code.

The problem using On Error Resume Next in routines is it will continue the routines and if VBA encounters an error, you cannot tell that it happened.

Place a single quote prior to the error trap to ensure it is overlooked and if an error occurs, VBA will halt execution of the code.

If this fails to disclose the problem,
place MsgBox "Layer Sub" in the MakeLayer subroutine so you can confirm that the routine is used.

If the MsgBox fails then ensure you have named the Tools module correctly and the CircleTest code point to Tools.

------------------
Regards
John Finlay
Don't want to post a question - email me direct on john@acecad.com.au

Posted: Mon Aug 20, 2001 7:16 pm
by tooldesigner
Method 'linetype' of Object 'IIcadLayer' Failed.

That is the error I get for some reason.

Posted: Tue Aug 21, 2001 2:30 am
by John Finlay
tooldesigner,

So it is the rouge linetype that is the cause! – OK lets fix that one.

Simple – make sure you have “Continuous” or ActiveLinetype as the MlineType in our argument to the MakeLayer subroutine – this will solve the problem – check your spelling just to make sure – Programming – I don’t know why I started; the syntax is killing me!.

The reason for enforcing the LineType and not accepting the default “Continuous” is because I wanted the user to have flexibility in our tools subroutine for differing linetypes.

OH well I tried.

You could add code to the MakeLayer subroutine
MlineType = “Continuous” and force the MlineType, however this would be defeating the purpose.

As an error check add:
MsgBox MlayerTxt
early in the MakeLayer routine to observe the variable.

Persistence pays – you learn more from corrected program errors than copy and paste.


------------------
Regards
John Finlay
Don't want to post a question - email me direct on john@acecad.com.au

[This message has been edited by John Finlay (edited 08-21-2001).]

Posted: Tue Aug 21, 2001 6:52 pm
by tooldesigner
OK I got it all fixed and working right. Thanks for your help. I also figured out why my color wasn't working right. I was folowing your code letter for letter. And there was a line where Mcolor was MColour. So I fixed that and my color working fine. Thanks again for your help and your time to help me learn this stuff.

Posted: Tue Aug 21, 2001 7:49 pm
by John Finlay
Good to here that you found the problem.

I have started VBA the Basic thread that may provide further insight into VBA.

Will start introducing some simple code examples soon.



------------------
Regards
John Finlay
Don't want to post a question - email me direct on john@acecad.com.au

[This message has been edited by John Finlay (edited 08-21-2001).]

Posted: Wed Aug 22, 2001 2:56 pm
by tooldesigner
Thanks for all you help. With some time and your help I should be able to start writing some useful stuff soon.