BOSTON, DEC. 28 -- Computervision Corp. filed suit today seeking to block a $400 million unsolicited takeover bid by Prime Computer Inc., a Computervision spokesman said.

The suit, filed in Delaware Chancery Court, seeks to allow the Bedford company to expand its number of shares to hamper the takeover attempt, which was announced Sunday, said Computervision spokesman Peter Connell.

Connell said the stock plan is included in a stockholders' rights plan the company adopted in February. He would not disclose how many new shares the plan would create at Computervision, which is incorporated in Delaware.

Joe Henson, Prime Computer's president and chief executive, said the company's board of directors voted unanimously last week to offer $13.50 per share for Computervision's nearly 29 million common shares outstanding.

Henson said the offer will extend to Jan. 26. If all stock is not purchased by that date, the company will have "re-evaluate its position at that point," he said.

In trading today on the New York Stock Exchange, Computervision jumped $4.25, to $13.25, while Prime Computer was up 87.5 cents to $14.37 1/2.

In a statement released today, Computervision President Robert Gable said the company will fight the takeover. Gable said the company had rejected an offer to merge the Massachusetts companies in 1985.

Since Computervision is not incorporated in Massachusetts it is not covered by the state's new antitakeover provisions.

The merged company would rank 242 on the Fortune 500 industrial ranking and would become the second-largest worldwide supplier of computer-aided design software and computers. Its CADCAM products allow engineers to do design work on computer terminals.

The new company would have an estimated $1.5 billion in annual revenue and more than $150 million in annual research and development spending.

Prime, with about 8,600 employes worldwide and ranking 337 on the Fortune 500 list, reported a profit of $43.5 million on revenue of $693.9 million for the first nine months of this year, compared with net income of $32.7 million on revenue of $629.2 million in the same period of 1986.

Computervision, which has about 4,600 employes worldwide, posted a nine-month profit of $11.4 million on revenue of $408.7 million, compared to a loss of $9.2 million on revenue of $358.2 million a year earlier.