Sexual harassment, assault and the likes aren't about attraction to someone, they're about power. Either exerting what little power someone has over a person they perceive qs weaker, or as a way to compensate for the power they don't have in other aspects of their life. But it's more about the perpetrator than the target.
I definitely agree with Ambi about not dressing down, that was actually my first thought and advice. Dressing down just sends potential victim signals in a weird way, and it doesn't make you less noticeable (unless you have an suit that can actually make you 100% invisible, but we're not talking science fiction here
). As a matter of fact, I've noticed that both baggy or more masculine clothing and ultra-feminine clothing do bring attention, but how people around me react to it is different: masculine clothing seems to give people the impression that they have a permission to step within my blurry, baggy boundaries and offer, at best, unsollicited advice on what I should wear, and at worst a hand on my bitt claiming that "they didn't realize they would touch my butt because my pants were so big". Seriously. On the other hand, I started wearing skirts and dresses as part of a uniform, but the person in charge of measurements messed up on the orders and I spent a year wearing a size smaller than I should have, turning the unsexy uniform of a US-based airline (we're talking late 90s-early 00s design, here, none of that fancy revamped stuff they wear now) into form-fitting pieces. Uniform implied make up and high-heeled shoes, too, hair done, etc. And... sure, it got me attention, but it got me even more respect somehow than regular clothing. I'll partially blame than on the uniform vs. plain clothes debate, though.
After that, I started wearing shift dresses outside, too, and looking like I was taking care of myself. I guess by then I also looked more confident overall. At any rate, it seems this combo gives strong inaccessible vibes, and perhaps predators just assume that someone who doesn't look bad (through effort) is more likely to not be available (and have a boyfriend who'll come beat up those guys who cross the line with their girlfriend, perhaps). I find it very sad that so many people adjust their attitude and the amount of respect they give to someone based on how they dress, but there isn't much I can do about it except dress the part of a non-target.
I'm not saying it's a foolproof technique, obviously, but it's worked rather well for me so far. Have I noticed that some people wanted to sleep with me? Sure. But they were easier to put back in their place, since I no longer looked like the mousey girl who wouldn't dare stand up to them.
Also, one final thought: I agree with everyone who explained that the guys' behavior at your workplace was some kind of pack thing, and they're trying to impress one another, claim you as a possession, etc. I should also add that I've had a couple of friends, NT girls with zero self-confidence, fall victim to bets on who could get them into their bed the faster, not because of good looks, but because their lack of confidence could be sensed. And I read a story somewhere about this poor English girl who met some guy while on vacation, and he and his friend had made a bet on who could bag up the plainest looking girl, some really heartbreaking story for the poor girl who thought she was being liked, while she was really given the runaround based on these guys' judgment on her looks. So, just be aware that there are such things going on, and that the best way to win such a bet is to be nice to the person, not downright insulting. I really hope this isn't the situation in your case, though.