Illustrator Scripting :: VB Syntax For Pathpoint Anchor
Nov 3, 2013
I am trying to (among other things) move a pathpoint that was added on a pathitem rectangle. The add of the pathitem goes well, the add of the pathpoint to the rectangle is fine, although when it it is "added" it picks some arbitrary position, hence the need to change the position, starting with the anchor.
I typically write in VB.NET (2013), as I am doing here. Using Illustrator CS6.
In VBScript, documentation shows:
newPoint.Anchor = Array(75, 300)
Using that syntax, I get a pre-complier error in VB.NET, as "Array" is a type and can't be used as an expression.To create an inline array in VB.NET, I would normally use:
newPoint.Anchor = {75, 300}
Using this syntax, I get a runtime COM-exception error.
but when i do it like that, the bject's name comes out as undefined when accessed like this dlg.btnPnl.cancelBtn.name or like this: dlg.btnPnl.children['name']
but adding the object then naming like this works-
dlg.btnPnl.cancelBtn.name = "Cancel";
I'm using illustrator cc and the extendscript guide for cs6 (couldn't find a newer one). Did the syntax change?
Is there any way to find a specific point on a path, that is not necessarily an anchor point?
What I'd like to be able to do is tell Illustrator "Give me the coordinates of the point that's exactly at half of this path's length" or "... exactly 25% ...". And if that's possible, can I somehow add an anchor point to that point, or cut the path at that point?
All I am trying to do is move an anchor from one location to another using vbscript. I have searched everywhere and scoured the scripting references but I have not been able to figure this out as of yet.
I am able to select anchor points without an issue....moving those points seems to be a problem.
I'm trying to get the position of point text from left anchor if left aligned, middle if center aligned and right if right aligned. is this even possible?
here are the keys of object I am trying to get at:
I am wondering if there is a way to add/remove/redistribute anchor points on a compound shape so that there are evenly spaced anchors along the outline of that shape.I am aware of the "add anchor points" command. But that adds a new anchor at EVERY midpoint between two anchors. It doesn't smartly calculate where to add and where to avoid adding anchors.
I'm trying to nudge the anchor points on an object randomly (to get an informal look). (I know some Effects do this already.)
Maintaining corner points is no problem - you just set the direction handles to the same coordinates as their anchor.
But I can't nudge a smooth point in the way I want to, which is to move the anchor but maintain the direction handles in exactly the same relation to their anchor as they had before. That is to say, they should remain smooth points.
My script calculates the difference between 'before' and 'after' positions of the anchor, and applies that difference to the direction handles… but in practice the smooth points are converted to corners, because the direction handles don't maintain their relation with the anchor.
var docRef = activeDocument; var objects = activeDocument.selection.length; var cShift = prompt("Point shift (pt)",5); // loop through all objects for(var count=0;count<objects;count++)
script that would sample the underlying color of anchor points in a selected gradient mesh and apply it to them? I was just thinking of ways to speed up the process of creating a vector drawing based on a picture so that all you would have to do is model your mesh and then let the script apply the colors.
I'm just wondering if there's some function to add an anchor point on a path between (exactly in the middle) two anchor points. Like Object > Path > Add Anchor Points, except only between two selected anchor points.
I have a shape in illustrator CS6 that I'm trying to edit. When I try to click on a point with the Delete Anchor Point Tool nothing happens however I am able to select the point using the Direct Selection Tool and then remove it using the "Remove selected anchor points" option in the Control palette. Same issue with trying to use the Convert Anchor Point Tool.
I'm try to automate the importing of the Varaible and datasets into my graphs via Scripting, but the ImportVaraibles() function doesn't seem to work. Here is my Script, mostly copied from the example script provided with Illustrator (CS5). And, this works manually, using the file names in the script, via Load Variable Library
Set appRef = CreateObject(strIllistratorVersion)
'Open the file and import the datasets Set docRef = appRef.Open(strTemplate & "200-500.ai") 'docRef.Datasets.RemoveAll docRef.Variables("Yearbook").Delete
Here is the problem, after I delete the previous library, then this next line, right from the example, does nothing The script then exits with 'No Datasets in this document'
docRef.ImportVariables (strXMLFolder & "Lumber_200-500.xml") 'appRef.DoJavaScript "alert('Template:" & strTemplate & strRange & ".ai | XML file:" & strXMLFolder & "" & objFile.Name & "^')" If (appRef.Documents.Count > 0) Then Set docRef = appRef.Documents(1)
[Code]....
If I remove that delete line, the script runs, but just uses whatever Variables I had last loaded, not the XML file.
It's simply not loading. What do I need to do to get it to load?
In Illustrator I have a path, I choose the add anchor point tool and am positive I have the cross hair exactly on the path but it keeps telling me I can't add the anchor point.
I've noticed that in Illustrator CC (17.1) the pen cursor doesn't automatically let you add or delete an anchor point anymore, when in Pen tool mode (P). It used to be an automatic feature in CS5, where a + or - sign would show up whenever I hovered over a selected path with the tool.
I draw with the pen tool a rectangle... When I click with the direct selection tool on the left side anchors, none of them have the corner widget... The right side anchors / both have corner widgets appearing.
I have tried clicking the left-side anchors and converting them to 'corners' both nothing happens..
I need to copy and paste path segments in order to create uniform serifs for letters. (For example, specific path curves).
So imagine I have a horizontal segment and a curve segment. I mouseover each one seperately and I can see they have anchor points where I want them to merge afterwards. I drag one towards the other to make them intersect. Then I try to select both anchor points and press CTRL + SHIFT + ALT + J, but it displays this error: "To join, you must select two open endpoints. (...)" Which makes me think I'm not really selecting both anchor points when they're overlapped.
I have the idea that they can't overlap, because my path segment won't detect the anchor point in the other path. They're just visually intersected but not connected.
If I try to join them when they aren't overlapped, they will join but distort the original shape of the path segments. I select them both with the Direct Selection tool, pressing Shift to add the second anchor point to the selection, which won't work when they're overlapped because Shift + Clicking will deselect the anchor that seems on top.
I also tried various shape modes in pathfinder and nothing works.
How can I properly overlap and join / merge them?
(I'm using a white fill so I can see the shape forming as I add more anchor points so I'm sure they aren't joined).
I want to move two opposite anchor points in opposite directions so that they are equally spaced. So if I have one anchor point I want to move right and the other left how can i make sure that they have equal spacing apart without having to resort to rulers. Is it possible to select both points and get them to move in opposite direction together?
The direct selection and lasso tools keep selecting entire paths. I thought these tools were for selecting individual or small groups of anchor points so that they can be edited. I am using Illustrator CS6, and I'm not sure if I'm doing something wrong or if my program is being buggy.
I wonder if there's an easy way to have the result just as if I used scissors tool on every anchor of a path. Clicking on every anchor is a tiresome labor.
In PS you can drag the center anchor point of an object anywhere within the object or canvas, allowing you to rotate around that custom location versus the dead-center of the object.
Is there a way to somehow define a shortkey to the process of removing our last anchor point's unused handle?
I am talking about this:
To be able to make a sharp corner I have to manually click on the anchor point so the handle which is still unused gets deleted. The anchor points are particulary small and the don't scale when zooming so sometimes it's just hard to click them and therefore I would love if I could automatically remove the handle with a key/key combination.
I have made a curved path in Illustrator CS6, just a simple stroke (left in picture). Is there an easy way to round the corner of the end of it? Something like the image on the right? (I just tossed a circle over top to give an idea)
I have a shape I made with the pen tool, and now I want to align one anchor point of the shape with the middle of a rectangle. How can I do this? It doesn't seem like I can do what I do for objects, which is select both objects, click the object I want to align to, and hit align. If I'm not describing this properly let me know and I can try to clarify.
When I use the simplify tool I get a small loop added to some corners of closed paths. It's such a great tool for what I do but it's basically useless like this.
In the above image, I have four symmetrical corners of an ellipse which I'm trying to join together into one ellipse that is perfectly symmetrical. I am trying to line up the anchors perfectly (one corner at time) and then do a join, yet the result is always slightly off. I've been selecting the two points I want to join and using Path -> Average, then Path -> Join to do this, yet as mentioned it's not coming out precise.