![]() By adding the variable, I just allowed the subroutine to allow a calling program to set the value (in percentage terms) of the margin. To help you understand it better, you could replace 'abMargin' with '10' (as per your original request) and then you would have a 10% extended margin. That value is set by the "caller" (the process that would be calling this subroutine). So let's say the you wanted 10% margin, then abMargin would equal 10. 'abMargin' is a variable that I created to allow modularity to the function. Here's a little background of my thinking and the process as I coded it: Work with me here and you will understand it a lot more in no time and you'll be coding this stuff in your sleep. PS: If you still need help in the conversion, let us know and if someone doesn't get to it first, I'll try to help. Public Sub DrawBorderPcnt(app As AI.Application, abMargin As Double)ĭim aDoc As AI.Document = app.ActiveDocumentĭim height = -(vb(3) - vb(1)) 'bottom-top I'm sure that I am missing something that someone else may spell out.ĥ) Lastly (thank goodness) in the future, you may be better served by opening a new discussion and referencing the old discussion link. While the documentation states a zero-based array value, in my testing I could only get it work as a 1-base array. While I could have made the code a little cleaner with less variables, I thought that spelling it out may help you understand the logic better.Ĥ) I noticed in a previous post's example the use of Artboards(0). I beileve that it works back to CS5, but I forget when (what version) the vertical scale was changed so before that it probably needs some adjustment.ģ) I used the variable abMargin to allow you to adjust easily the percentage that you desire in margins for your artboard. Since you chose a "square" excample, you may or may not have considered that.Ģ) This has been tested on CS6. At minimum, you'll understand the differences a little bit.ġ) You may or may not find that you desire a consistent margin on a rectangular-dimensioned collection of pathitems. ![]() OK - this will challange you a little bit, in that you have to do a little conversion from VB.NET to JS, but this should do the trick for you. Does anyone know how to point the JS at a folder? Var myVisibleBounds = doc.visibleBounds //Rect, which is an array ĭoc.artboards.artboardRect = myVisibleBounds īut this is limited, since you can only load so many files at once into Illustrator. ![]() It's helpful to know that the left value and the bottom value begin at zero thus, when you want to add space to the artboard, you need negative numbers, as shown. Keep in mind that the values are in the sequence are: left, top, right, and bottom dimensions.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |